diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Screen.cc | 46 | ||||
-rw-r--r-- | src/fluxbox.cc | 3 |
2 files changed, 30 insertions, 19 deletions
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 | |||
1199 | 1199 | ||
1200 | FbTk::App::instance()->sync(false); | 1200 | FbTk::App::instance()->sync(false); |
1201 | 1201 | ||
1202 | if (win && &win->screen() == this && | 1202 | if (!win || &win->screen() != this || win->isStuck()) |
1203 | (! win->isStuck())) { | 1203 | return; |
1204 | 1204 | ||
1205 | // if iconified, deiconify it before we send it somewhere | 1205 | // if iconified, deiconify it before we send it somewhere |
1206 | if (win->isIconic()) | 1206 | if (win->isIconic()) |
1207 | win->deiconify(); | 1207 | win->deiconify(); |
1208 | 1208 | ||
1209 | // if the window isn't on current workspace, hide it | 1209 | // if the window isn't on current workspace, hide it |
1210 | if (id != currentWorkspace()->workspaceID()) | 1210 | if (id != currentWorkspace()->workspaceID()) |
1211 | win->withdraw(true); | 1211 | win->withdraw(true); |
1212 | 1212 | ||
1213 | windowMenu().hide(); | 1213 | windowMenu().hide(); |
1214 | 1214 | ||
1215 | reassociateWindow(win, id, true); | 1215 | reassociateWindow(win, id, true); |
1216 | 1216 | ||
1217 | // if the window is on current workspace, show it. | 1217 | // if the window is on current workspace, show it. |
1218 | if (id == currentWorkspace()->workspaceID()) | 1218 | if (id == currentWorkspace()->workspaceID()) |
1219 | win->deiconify(false, false); | 1219 | win->deiconify(false, false); |
1220 | 1220 | ||
1221 | // change workspace ? | 1221 | // change workspace ? |
1222 | if (changeWS && id != currentWorkspace()->workspaceID()) { | 1222 | if (changeWS && id != currentWorkspace()->workspaceID()) { |
1223 | changeWorkspaceID(id); | 1223 | changeWorkspaceID(id); |
1224 | win->setInputFocus(); | 1224 | win->setInputFocus(); |
1225 | } | 1225 | } |
1226 | 1226 | ||
1227 | // send all the transients too | ||
1228 | FluxboxWindow::ClientList::iterator client_it = win->clientList().begin(); | ||
1229 | FluxboxWindow::ClientList::iterator client_it_end = win->clientList().end(); | ||
1230 | for (; client_it != client_it_end; ++client_it) { | ||
1231 | WinClient::TransientList::const_iterator it = (*client_it)->transientList().begin(); | ||
1232 | WinClient::TransientList::const_iterator it_end = (*client_it)->transientList().end(); | ||
1233 | for (; it != it_end; ++it) { | ||
1234 | if ((*it)->fbwindow()) | ||
1235 | sendToWorkspace(id, (*it)->fbwindow(), false); | ||
1236 | } | ||
1227 | } | 1237 | } |
1228 | 1238 | ||
1229 | } | 1239 | } |
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) { | |||
916 | #ifdef DEBUG | 916 | #ifdef DEBUG |
917 | cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out is not a FluxboxWindow !!"<<endl; | 917 | cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out is not a FluxboxWindow !!"<<endl; |
918 | #endif // DEBUG | 918 | #endif // DEBUG |
919 | } else if (winclient && winclient == FocusControl::focusedWindow() && | 919 | } else if (winclient && (winclient == FocusControl::focusedWindow() || |
920 | FocusControl::focusedWindow() == 0) && | ||
920 | (winclient->fbwindow() == 0 | 921 | (winclient->fbwindow() == 0 |
921 | || !winclient->fbwindow()->isMoving())) { | 922 | || !winclient->fbwindow()->isMoving())) { |
922 | // we don't unfocus a moving window | 923 | // we don't unfocus a moving window |