properly lower windows and keep desktop windows on the bottom.

This commit is contained in:
Dana Jansens 2002-07-13 21:25:19 +00:00
parent 043e42a316
commit 8cb1108f4e
3 changed files with 22 additions and 11 deletions

View file

@ -1380,13 +1380,27 @@ void BScreen::raiseWindows(Window *workspace_stack, unsigned int num) {
} }
void BScreen::lowerDesktops(void) { void BScreen::lowerWindows(Window *workspace_stack, unsigned int num) {
if (desktopWindowList.empty()) return; assert(num > 0); // this would cause trouble in the XRaiseWindow call
XLowerWindow(blackbox->getXDisplay(), desktopWindowList[0]); Window *session_stack = new Window[(num + desktopWindowList.size())];
if (desktopWindowList.size() > 1) unsigned int i = 0, k = num;
XRestackWindows(blackbox->getXDisplay(), &desktopWindowList[0],
desktopWindowList.size()); 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();
} }

View file

@ -326,7 +326,7 @@ public:
void manageWindow(Window w); void manageWindow(Window w);
void unmanageWindow(BlackboxWindow *w, bool remap); void unmanageWindow(BlackboxWindow *w, bool remap);
void raiseWindows(Window *workspace_stack, unsigned int num); 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, void reassociateWindow(BlackboxWindow *w, unsigned int wkspc_id,
bool ignore_sticky); bool ignore_sticky);
void propagateWindowName(const BlackboxWindow *bw); void propagateWindowName(const BlackboxWindow *bw);

View file

@ -322,10 +322,7 @@ void Workspace::lowerWindow(BlackboxWindow *w) {
wkspc->stackingList.push_back(win); wkspc->stackingList.push_back(win);
} }
XLowerWindow(screen->getBaseDisplay()->getXDisplay(), stack_vector.front()); screen->lowerWindows(&stack_vector[0], stack_vector.size());
XRestackWindows(screen->getBaseDisplay()->getXDisplay(),
&stack_vector[0], stack_vector.size());
screen->lowerDesktops();
} }