]> Dogcows Code - chaz/openbox/commitdiff
properly lower windows and keep desktop windows on the bottom.
authorDana Jansens <danakj@orodu.net>
Sat, 13 Jul 2002 21:25:19 +0000 (21:25 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 13 Jul 2002 21:25:19 +0000 (21:25 +0000)
src/Screen.cc
src/Screen.hh
src/Workspace.cc

index 9922435023e6ebc74dad250b1680ee967cb866ba..0186e97bf26384db990cec7a7d2ed49500674dce 100644 (file)
@@ -1380,13 +1380,27 @@ void BScreen::raiseWindows(Window *workspace_stack, unsigned int num) {
 }
 
 
-void BScreen::lowerDesktops(void) {
-  if (desktopWindowList.empty()) return;
+void BScreen::lowerWindows(Window *workspace_stack, unsigned int num) {
+  assert(num > 0);  // this would cause trouble in the XRaiseWindow call
 
-  XLowerWindow(blackbox->getXDisplay(), desktopWindowList[0]);
-  if (desktopWindowList.size() > 1)
-    XRestackWindows(blackbox->getXDisplay(), &desktopWindowList[0],
-                    desktopWindowList.size());
+  Window *session_stack = new Window[(num + desktopWindowList.size())];
+  unsigned int i = 0, k = num;
+
+  XLowerWindow(blackbox->getXDisplay(), workspace_stack[0]);
+
+  while (k--)
+    *(session_stack + i++) = *(workspace_stack + k);
+
+  WindowList::iterator dit = desktopWindowList.begin();
+  const WindowList::iterator d_end = desktopWindowList.end();
+  for (; dit != d_end; ++dit)
+    *(session_stack + i++) = *dit;
+
+  XRestackWindows(blackbox->getXDisplay(), session_stack, i);
+
+  delete [] session_stack;
+
+  updateStackingList();
 }
 
 
index 36a9f3cc5077c5bb46a73324e2b11853b4ecb1aa..8986803bdcc6898dc234787473e53c7f4df75521 100644 (file)
@@ -326,7 +326,7 @@ public:
   void manageWindow(Window w);
   void unmanageWindow(BlackboxWindow *w, bool remap);
   void raiseWindows(Window *workspace_stack, unsigned int num);
-  void lowerDesktops(void);
+  void lowerWindows(Window *workspace_stack, unsigned int num);
   void reassociateWindow(BlackboxWindow *w, unsigned int wkspc_id,
                          bool ignore_sticky);
   void propagateWindowName(const BlackboxWindow *bw);
index 9606140d6262392dbcfdf2205757b7203f85b8e7..c017d3e505daf5e019fefa5543f6b5d030475b1b 100644 (file)
@@ -322,10 +322,7 @@ void Workspace::lowerWindow(BlackboxWindow *w) {
     wkspc->stackingList.push_back(win);
   }
 
-  XLowerWindow(screen->getBaseDisplay()->getXDisplay(), stack_vector.front());
-  XRestackWindows(screen->getBaseDisplay()->getXDisplay(),
-                  &stack_vector[0], stack_vector.size());
-  screen->lowerDesktops();
+  screen->lowerWindows(&stack_vector[0], stack_vector.size());
 }
 
 
This page took 0.026324 seconds and 4 git commands to generate.