diff options
author | fluxgen <fluxgen> | 2002-09-07 20:22:08 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-09-07 20:22:08 (GMT) |
commit | 314c3116f0778f8a91c4aa605f7d3ffe57246e80 (patch) | |
tree | 44c5696ce4304c73ef7b978dca49489a0673610a /src/Screen.cc | |
parent | 54d855ee5947d6575d04d2a26cf5132df1f003ec (diff) | |
download | fluxbox-314c3116f0778f8a91c4aa605f7d3ffe57246e80.zip fluxbox-314c3116f0778f8a91c4aa605f7d3ffe57246e80.tar.bz2 |
added subjects and removed gnome stuff
Diffstat (limited to 'src/Screen.cc')
-rw-r--r-- | src/Screen.cc | 152 |
1 files changed, 21 insertions, 131 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 60c8a63..492f0d1 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Screen.cc,v 1.65 2002/08/30 14:03:31 fluxgen Exp $ | 25 | // $Id: Screen.cc,v 1.66 2002/09/07 20:22:08 fluxgen Exp $ |
26 | 26 | ||
27 | //use GNU extensions | 27 | //use GNU extensions |
28 | #ifndef _GNU_SOURCE | 28 | #ifndef _GNU_SOURCE |
@@ -220,9 +220,11 @@ toolbar_placement(rm, Toolbar::BOTTOMCENTER, scrname+".toolbar.placement", altsc | |||
220 | BScreen::BScreen(ResourceManager &rm, Fluxbox *b, | 220 | BScreen::BScreen(ResourceManager &rm, Fluxbox *b, |
221 | const string &screenname, const string &altscreenname, | 221 | const string &screenname, const string &altscreenname, |
222 | int scrn) : ScreenInfo(b, scrn), | 222 | int scrn) : ScreenInfo(b, scrn), |
223 | #ifdef GNOME | 223 | m_clientlist_sig(*this), // client signal |
224 | gnome_win(None), | 224 | m_workspacecount_sig(*this), // workspace count signal |
225 | #endif | 225 | m_workspacenames_sig(*this), // workspace names signal |
226 | m_currentworkspace_sig(*this), // current workspace signal | ||
227 | |||
226 | theme(0), | 228 | theme(0), |
227 | resource(rm, screenname, altscreenname) | 229 | resource(rm, screenname, altscreenname) |
228 | { | 230 | { |
@@ -279,9 +281,6 @@ resource(rm, screenname, altscreenname) | |||
279 | theme = new Theme(getBaseDisplay()->getXDisplay(), getRootWindow(), colormap(), getScreenNumber(), | 281 | theme = new Theme(getBaseDisplay()->getXDisplay(), getRootWindow(), colormap(), getScreenNumber(), |
280 | image_control, fluxbox->getStyleFilename(), getRootCommand().c_str()); | 282 | image_control, fluxbox->getStyleFilename(), getRootCommand().c_str()); |
281 | 283 | ||
282 | #ifdef GNOME | ||
283 | initGnomeAtoms(); | ||
284 | #endif | ||
285 | 284 | ||
286 | #ifdef NEWWMSPEC | 285 | #ifdef NEWWMSPEC |
287 | Atom netwmsupported[] = { | 286 | Atom netwmsupported[] = { |
@@ -446,6 +445,8 @@ resource(rm, screenname, altscreenname) | |||
446 | if (!win->isManaged()) { | 445 | if (!win->isManaged()) { |
447 | delete win; | 446 | delete win; |
448 | win = 0; | 447 | win = 0; |
448 | } else { | ||
449 | Fluxbox::instance()->attachSignals(*win); | ||
449 | } | 450 | } |
450 | 451 | ||
451 | if (win) { | 452 | if (win) { |
@@ -475,9 +476,6 @@ namespace { | |||
475 | } | 476 | } |
476 | 477 | ||
477 | BScreen::~BScreen() { | 478 | BScreen::~BScreen() { |
478 | #ifdef GNOME | ||
479 | XDestroyWindow(getBaseDisplay()->getXDisplay(), gnome_win); | ||
480 | #endif | ||
481 | if (! managed) return; | 479 | if (! managed) return; |
482 | 480 | ||
483 | if (geom_pixmap != None) | 481 | if (geom_pixmap != None) |
@@ -666,30 +664,7 @@ void BScreen::removeWorkspaceNames() { | |||
666 | } | 664 | } |
667 | 665 | ||
668 | void BScreen::updateWorkspaceNamesAtom() { | 666 | void BScreen::updateWorkspaceNamesAtom() { |
669 | 667 | m_workspacenames_sig.notify(); | |
670 | #ifdef GNOME | ||
671 | XTextProperty text; | ||
672 | int number_of_desks = workspaceNames.size(); | ||
673 | |||
674 | char s[1024]; | ||
675 | char *names[number_of_desks]; | ||
676 | |||
677 | for (int i = 0; i < number_of_desks; i++) { | ||
678 | sprintf(s, "Desktop %i", i); | ||
679 | names[i] = new char[strlen(s) + 1]; | ||
680 | strcpy(names[i], s); | ||
681 | } | ||
682 | |||
683 | if (XStringListToTextProperty(names, number_of_desks, &text)) { | ||
684 | XSetTextProperty(getBaseDisplay()->getXDisplay(), getRootWindow(), | ||
685 | &text, FbAtoms::instance()->getGnomeWorkspaceNamesAtom()); | ||
686 | XFree(text.value); | ||
687 | } | ||
688 | |||
689 | for (int i = 0; i < number_of_desks; i++) | ||
690 | delete names[i]; | ||
691 | |||
692 | #endif | ||
693 | 668 | ||
694 | } | 669 | } |
695 | 670 | ||
@@ -899,21 +874,15 @@ void BScreen::removeNetizen(Window w) { | |||
899 | 874 | ||
900 | 875 | ||
901 | void BScreen::updateNetizenCurrentWorkspace() { | 876 | void BScreen::updateNetizenCurrentWorkspace() { |
902 | #ifdef NEWWMSPEC | 877 | #ifdef NEWWMSPEC |
903 | //update _NET_WM_CURRENT_DESKTOP | 878 | //update _NET_WM_CURRENT_DESKTOP |
904 | int workspace = getCurrentWorkspaceID(); | 879 | int workspace = getCurrentWorkspaceID(); |
905 | XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(), | 880 | XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(), |
906 | getBaseDisplay()->getNETCurrentDesktopAtom(), XA_CARDINAL, 32, PropModeReplace, | 881 | getBaseDisplay()->getNETCurrentDesktopAtom(), XA_CARDINAL, 32, PropModeReplace, |
907 | (unsigned char *)&workspace, 1); | 882 | (unsigned char *)&workspace, 1); |
908 | #endif | 883 | #endif // NEWWMSPEC |
909 | #ifdef GNOME | 884 | |
910 | //update _WIN_WORKSPACE | 885 | m_currentworkspace_sig.notify(); |
911 | int gnome_workspace = getCurrentWorkspaceID(); | ||
912 | XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(), | ||
913 | FbAtoms::instance()->getGnomeWorkspaceAtom(), XA_CARDINAL, 32, PropModeReplace, | ||
914 | (unsigned char *)&gnome_workspace, 1); | ||
915 | updateGnomeClientList(); | ||
916 | #endif | ||
917 | 886 | ||
918 | Netizens::iterator it = netizenList.begin(); | 887 | Netizens::iterator it = netizenList.begin(); |
919 | Netizens::iterator it_end = netizenList.end(); | 888 | Netizens::iterator it_end = netizenList.end(); |
@@ -931,22 +900,15 @@ void BScreen::updateNetizenWorkspaceCount() { | |||
931 | for (; it != it_end; ++it) { | 900 | for (; it != it_end; ++it) { |
932 | (*it)->sendWorkspaceCount(); | 901 | (*it)->sendWorkspaceCount(); |
933 | } | 902 | } |
934 | #ifdef NEWWMSPEC | 903 | #ifdef NEWWMSPEC |
935 | //update _NET_WM_NUMBER_OF_DESKTOPS | 904 | //update _NET_WM_NUMBER_OF_DESKTOPS |
936 | int numworkspaces = getCount()-1; | 905 | int numworkspaces = getCount()-1; |
937 | XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(), | 906 | XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(), |
938 | getBaseDisplay()->getNETNumberOfDesktopsAtom(), XA_CARDINAL, 32, PropModeReplace, | 907 | getBaseDisplay()->getNETNumberOfDesktopsAtom(), XA_CARDINAL, 32, PropModeReplace, |
939 | (unsigned char *)&numworkspaces, 1); | 908 | (unsigned char *)&numworkspaces, 1); |
940 | #endif | 909 | #endif // NEWWMSPEC |
941 | 910 | ||
942 | #ifdef GNOME | 911 | m_workspacecount_sig.notify(); |
943 | { | ||
944 | int numworkspaces = getCount(); | ||
945 | XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(), | ||
946 | FbAtoms::instance()->getGnomeWorkspaceCountAtom(), XA_CARDINAL, 32, PropModeReplace, | ||
947 | (unsigned char *)&numworkspaces, 1); | ||
948 | } | ||
949 | #endif | ||
950 | 912 | ||
951 | } | 913 | } |
952 | 914 | ||
@@ -969,9 +931,8 @@ void BScreen::updateNetizenWindowAdd(Window w, unsigned long p) { | |||
969 | for (; it != it_end; ++it) { | 931 | for (; it != it_end; ++it) { |
970 | (*it)->sendWindowAdd(w, p); | 932 | (*it)->sendWindowAdd(w, p); |
971 | } | 933 | } |
972 | #ifdef GNOME | 934 | |
973 | updateGnomeClientList(); | 935 | m_clientlist_sig.notify(); |
974 | #endif | ||
975 | 936 | ||
976 | } | 937 | } |
977 | 938 | ||
@@ -982,9 +943,8 @@ void BScreen::updateNetizenWindowDel(Window w) { | |||
982 | for (; it != it_end; ++it) { | 943 | for (; it != it_end; ++it) { |
983 | (*it)->sendWindowDel(w); | 944 | (*it)->sendWindowDel(w); |
984 | } | 945 | } |
985 | #ifdef GNOME | 946 | |
986 | updateGnomeClientList(); | 947 | m_clientlist_sig.notify(); |
987 | #endif | ||
988 | } | 948 | } |
989 | 949 | ||
990 | 950 | ||
@@ -1761,73 +1721,3 @@ FluxboxWindow* BScreen::useAutoGroupWindow() { | |||
1761 | return w ? Fluxbox::instance()->searchWindow(w) : 0; | 1721 | return w ? Fluxbox::instance()->searchWindow(w) : 0; |
1762 | } | 1722 | } |
1763 | 1723 | ||
1764 | #ifdef GNOME | ||
1765 | void BScreen::initGnomeAtoms() { | ||
1766 | |||
1767 | /* create the GNOME window */ | ||
1768 | gnome_win = XCreateSimpleWindow(getBaseDisplay()->getXDisplay(), | ||
1769 | getRootWindow(), 0, 0, 5, 5, 0, 0, 0); | ||
1770 | FbAtoms *fba = FbAtoms::instance(); | ||
1771 | /* supported WM check */ | ||
1772 | XChangeProperty(getBaseDisplay()->getXDisplay(), | ||
1773 | getRootWindow(), fba->getGnomeSupportingWMCheckAtom(), | ||
1774 | XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1); | ||
1775 | |||
1776 | XChangeProperty(getBaseDisplay()->getXDisplay(), gnome_win, | ||
1777 | fba->getGnomeSupportingWMCheckAtom(), | ||
1778 | XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1); | ||
1779 | |||
1780 | Atom gnomeatomlist[] = { | ||
1781 | fba->getGnomeWorkspaceAtom(), | ||
1782 | fba->getGnomeWorkspaceCountAtom(), | ||
1783 | fba->getGnomeStateAtom(), | ||
1784 | fba->getGnomeWorkspaceNamesAtom(), | ||
1785 | fba->getGnomeHintsAtom(), | ||
1786 | fba->getGnomeClientListAtom(), | ||
1787 | // getBaseDisplay()->getGnomeLayerAtom(), // not supported yet | ||
1788 | }; | ||
1789 | |||
1790 | //list atoms that we support | ||
1791 | XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(), | ||
1792 | fba->getGnomeProtAtom(), XA_ATOM, 32, PropModeReplace, | ||
1793 | (unsigned char *)gnomeatomlist, (sizeof gnomeatomlist)/sizeof gnomeatomlist[0]); | ||
1794 | |||
1795 | } | ||
1796 | |||
1797 | void BScreen::updateGnomeClientList() { | ||
1798 | int num=0; | ||
1799 | Workspaces::iterator workspace_it = workspacesList.begin(); | ||
1800 | Workspaces::iterator workspace_it_end = workspacesList.end(); | ||
1801 | for (; workspace_it != workspace_it_end; ++workspace_it) { | ||
1802 | num += (*workspace_it)->getWindowList().size(); | ||
1803 | } | ||
1804 | //int num = getCurrentWorkspace()->getWindowList().size(); | ||
1805 | |||
1806 | Window *wl = new Window[num]; | ||
1807 | //start the iterator from begining | ||
1808 | workspace_it = workspacesList.begin(); | ||
1809 | int win=0; | ||
1810 | for (; workspace_it != workspace_it_end; ++workspace_it) { | ||
1811 | |||
1812 | // Fill in array of window ID's | ||
1813 | Workspace::Windows::const_iterator it = (*workspace_it)->getWindowList().begin(); | ||
1814 | Workspace::Windows::const_iterator it_end = (*workspace_it)->getWindowList().end(); | ||
1815 | for (; it != it_end; ++it) { | ||
1816 | //check if the window don't want to be visible in the list | ||
1817 | if (! ( (*it)->getGnomeHints() & FluxboxWindow::WIN_STATE_HIDDEN) ) { | ||
1818 | wl[win++] = (*it)->getClientWindow(); | ||
1819 | } | ||
1820 | } | ||
1821 | } | ||
1822 | //number of windows to show in client list | ||
1823 | num = win; | ||
1824 | XChangeProperty(getBaseDisplay()->getXDisplay(), | ||
1825 | getRootWindow(), FbAtoms::instance()->getGnomeClientListAtom(), XA_CARDINAL, 32, | ||
1826 | PropModeReplace, (unsigned char *)wl, num); | ||
1827 | |||
1828 | if (wl) | ||
1829 | delete wl; | ||
1830 | } | ||
1831 | |||
1832 | #endif //!GNOME | ||
1833 | |||