From 226ec5d3715e7433fa1933e0507ae20d20f0453f Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 3 Jun 2007 20:27:52 +0000 Subject: send transient windows along with sendtoworkspace --- ChangeLog | 3 +++ src/Screen.cc | 46 ++++++++++++++++++++++++++++------------------ src/fluxbox.cc | 3 ++- 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3e459b2..ccf534b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ (Format: Year/Month/Day) Changes for 1.0.0: *07/06/03: + * Also send transient windows when sending a window to another workspace, bug + #1716900 (Mark) + Screen.cc * Only change layer to normal when removing _NET_WM_STATE_{ABOVE,BELOW} if the window is actually above/below the normal layer (thanks Jim Ramsay) Ewmh.cc diff --git a/src/Screen.cc b/src/Screen.cc index 625e412..3db8ddc 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1199,31 +1199,41 @@ void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS FbTk::App::instance()->sync(false); - if (win && &win->screen() == this && - (! win->isStuck())) { + if (!win || &win->screen() != this || win->isStuck()) + return; - // if iconified, deiconify it before we send it somewhere - if (win->isIconic()) - win->deiconify(); + // if iconified, deiconify it before we send it somewhere + if (win->isIconic()) + win->deiconify(); - // if the window isn't on current workspace, hide it - if (id != currentWorkspace()->workspaceID()) - win->withdraw(true); + // if the window isn't on current workspace, hide it + if (id != currentWorkspace()->workspaceID()) + win->withdraw(true); - windowMenu().hide(); + windowMenu().hide(); - reassociateWindow(win, id, true); + reassociateWindow(win, id, true); - // if the window is on current workspace, show it. - if (id == currentWorkspace()->workspaceID()) - win->deiconify(false, false); + // if the window is on current workspace, show it. + if (id == currentWorkspace()->workspaceID()) + win->deiconify(false, false); - // change workspace ? - if (changeWS && id != currentWorkspace()->workspaceID()) { - changeWorkspaceID(id); - win->setInputFocus(); - } + // change workspace ? + if (changeWS && id != currentWorkspace()->workspaceID()) { + changeWorkspaceID(id); + win->setInputFocus(); + } + // send all the transients too + FluxboxWindow::ClientList::iterator client_it = win->clientList().begin(); + FluxboxWindow::ClientList::iterator client_it_end = win->clientList().end(); + for (; client_it != client_it_end; ++client_it) { + WinClient::TransientList::const_iterator it = (*client_it)->transientList().begin(); + WinClient::TransientList::const_iterator it_end = (*client_it)->transientList().end(); + for (; it != it_end; ++it) { + if ((*it)->fbwindow()) + sendToWorkspace(id, (*it)->fbwindow(), false); + } } } diff --git a/src/fluxbox.cc b/src/fluxbox.cc index ef747e6..352caf0 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -916,7 +916,8 @@ void Fluxbox::handleEvent(XEvent * const e) { #ifdef DEBUG cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out is not a FluxboxWindow !!"<fbwindow() == 0 || !winclient->fbwindow()->isMoving())) { // we don't unfocus a moving window -- cgit v0.11.2