From 64de0ae568c01adf839c4b73c6705caa40bb3c6a Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 3 Jun 2007 20:17:06 +0000 Subject: send transients along with window to other workspaces --- ChangeLog | 3 +++ src/Screen.cc | 38 +++++++++++++++++++++++++------------- src/fluxbox.cc | 3 ++- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index b1ef73a..a903f27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ (Format: Year/Month/Day) Changes for 1.1: *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 096286b..dbf2ce6 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1267,24 +1267,36 @@ void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS if (!win) win = FocusControl::focusedFbWindow(); - FbTk::App::instance()->sync(false); - - if (win && &win->screen() == this) { + if (!win || &win->screen() != this) + return; - windowMenu().hide(); + FbTk::App::instance()->sync(false); - reassociateWindow(win, id, true); + windowMenu().hide(); + reassociateWindow(win, id, true); - // change workspace ? - if (changeWS) - changeWorkspaceID(id); + // change workspace ? + if (changeWS) + changeWorkspaceID(id); - // if the window is on current workspace, show it; else hide it. - if (id == currentWorkspace()->workspaceID()) - win->deiconify(false, false); - else - win->withdraw(true); + // if the window is on current workspace, show it; else hide it. + if (id == currentWorkspace()->workspaceID() && !win->isIconic()) + win->deiconify(false, false); + else { + win->withdraw(true); + FocusControl::revertFocus(*this); + } + // 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 25924c3..5210def 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -919,7 +919,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