}
-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();
}
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);
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());
}