From ef969ea966fc15138f927392262558e99d359bbd Mon Sep 17 00:00:00 2001 From: fluxgen Date: Wed, 20 Feb 2002 22:41:13 +0000 Subject: added updateGnomeClientList --- src/Screen.cc | 44 +++++++++++++++++++++++++++++++++++++------- src/Screen.hh | 20 ++++++++++---------- 2 files changed, 47 insertions(+), 17 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index 8444480..f3a833c 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.25 2002/02/17 19:19:05 fluxgen Exp $ +// $Id: Screen.cc,v 1.26 2002/02/20 22:40:19 fluxgen Exp $ // stupid macros needed to access some functions in version 2 of the GNU C // library @@ -702,6 +702,7 @@ void BScreen::addIcon(FluxboxWindow *w) { void BScreen::removeIcon(FluxboxWindow *w) { if (! w) return; + { Icons::iterator it = iconList.begin(); Icons::iterator it_end = iconList.end(); @@ -712,8 +713,7 @@ void BScreen::removeIcon(FluxboxWindow *w) { } } } - //std::remove(iconList.begin(), iconList.end(), w); - + iconmenu->remove(w->getWindowNumber()); iconmenu->update(); toolbar->delIcon(w); @@ -925,7 +925,10 @@ void BScreen::updateNetizenWindowAdd(Window w, unsigned long p) { for (; it != it_end; ++it) { (*it)->sendWindowAdd(w, p); } - + #ifdef GNOME + updateGnomeClientList(); + #endif + } @@ -935,7 +938,9 @@ void BScreen::updateNetizenWindowDel(Window w) { for (; it != it_end; ++it) { (*it)->sendWindowDel(w); } - + #ifdef GNOME + updateGnomeClientList(); + #endif } @@ -967,7 +972,7 @@ void BScreen::updateNetizenConfigNotify(XEvent *e) { void BScreen::raiseWindows(Window *workspace_stack, int num) { - Window session_stack[(num + workspacesList.size() + rootmenuList.size() + 13)]; + Window session_stack[(num + workspacesList.size() + rootmenuList.size() + 30)]; int i = 0; XRaiseWindow(getBaseDisplay()->getXDisplay(), iconmenu->getWindowID()); @@ -1761,7 +1766,8 @@ void BScreen::initGnomeAtoms(void) { getBaseDisplay()->getGnomeWorkspaceCountAtom(), getBaseDisplay()->getGnomeStateAtom(), getBaseDisplay()->getGnomeWorkspaceNamesAtom(), - getBaseDisplay()->getGnomeHintsAtom() + getBaseDisplay()->getGnomeHintsAtom(), + getBaseDisplay()->getGnomeClientListAtom(), }; //list atoms that we support @@ -1770,4 +1776,28 @@ void BScreen::initGnomeAtoms(void) { (unsigned char *)gnomeatomlist, (sizeof gnomeatomlist)/sizeof gnomeatomlist[0]); } + +void BScreen::updateGnomeClientList() { + int num = getCurrentWorkspace()->getWindowList().size(); + Window *wl = new Window[num]; + // Fill in array of window ID's + Workspace::Windows::iterator it = getCurrentWorkspace()->getWindowList().begin(); + Workspace::Windows::iterator it_end = getCurrentWorkspace()->getWindowList().end(); + int win=0; + for (; it != it_end; ++it) { + //check if the window don't want to be visible in the list + if (! ( (*it)->getGnomeHints() & FluxboxWindow::WIN_STATE_HIDDEN) ) { + wl[win++] = (*it)->getClientWindow(); + } + } + + num = win; + XChangeProperty(getBaseDisplay()->getXDisplay(), + getRootWindow(), getBaseDisplay()->getGnomeClientListAtom(), XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)wl, num); + + if (wl) + delete wl; +} + #endif //!GNOME diff --git a/src/Screen.hh b/src/Screen.hh index b64664c..0001ed0 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.hh,v 1.18 2002/02/17 18:54:58 fluxgen Exp $ +// $Id: Screen.hh,v 1.19 2002/02/20 22:41:13 fluxgen Exp $ #ifndef SCREEN_HH #define SCREEN_HH @@ -165,15 +165,15 @@ public: inline Iconmenu *getIconmenu(void) { return iconmenu; } -#ifdef HAVE_STRFTIME + #ifdef HAVE_STRFTIME inline char *getStrftimeFormat(void) { return resource.strftime_format; } void saveStrftimeFormat(char *); -#else // !HAVE_STRFTIME + #else // !HAVE_STRFTIME inline int getDateFormat(void) { return resource.date_format; } inline void saveDateFormat(int f) { resource.date_format = f; } inline Bool isClock24Hour(void) { return resource.clock24hour; } inline void saveClock24Hour(Bool c) { resource.clock24hour = c; } -#endif // HAVE_STRFTIME + #endif // HAVE_STRFTIME inline Theme::WindowStyle *getWindowStyle(void) { return &theme->getWindowStyle(); } inline Theme::MenuStyle *getMenuStyle(void) { return &theme->getMenuStyle(); } @@ -231,6 +231,7 @@ public: private: #ifdef GNOME void initGnomeAtoms(); + void updateGnomeClientList(); Window gnome_win; #endif Theme *theme; @@ -291,19 +292,18 @@ private: Resource toolbar_placement; -#ifdef SLIT + #ifdef SLIT Bool slit_on_top, slit_auto_hide; int slit_placement, slit_direction; -#endif // SLIT + #endif // SLIT -#ifdef HAVE_STRFTIME + #ifdef HAVE_STRFTIME char *strftime_format; -#else // !HAVE_STRFTIME + #else // !HAVE_STRFTIME Bool clock24hour; int date_format; -#endif // HAVE_STRFTIME - + #endif // HAVE_STRFTIME } resource; -- cgit v0.11.2