aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc38
1 files changed, 25 insertions, 13 deletions
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
1267 if (!win) 1267 if (!win)
1268 win = FocusControl::focusedFbWindow(); 1268 win = FocusControl::focusedFbWindow();
1269 1269
1270 FbTk::App::instance()->sync(false); 1270 if (!win || &win->screen() != this)
1271 1271 return;
1272 if (win && &win->screen() == this) {
1273 1272
1274 windowMenu().hide(); 1273 FbTk::App::instance()->sync(false);
1275 1274
1276 reassociateWindow(win, id, true); 1275 windowMenu().hide();
1276 reassociateWindow(win, id, true);
1277 1277
1278 // change workspace ? 1278 // change workspace ?
1279 if (changeWS) 1279 if (changeWS)
1280 changeWorkspaceID(id); 1280 changeWorkspaceID(id);
1281 1281
1282 // if the window is on current workspace, show it; else hide it. 1282 // if the window is on current workspace, show it; else hide it.
1283 if (id == currentWorkspace()->workspaceID()) 1283 if (id == currentWorkspace()->workspaceID() && !win->isIconic())
1284 win->deiconify(false, false); 1284 win->deiconify(false, false);
1285 else 1285 else {
1286 win->withdraw(true); 1286 win->withdraw(true);
1287 FocusControl::revertFocus(*this);
1288 }
1287 1289
1290 // send all the transients too
1291 FluxboxWindow::ClientList::iterator client_it = win->clientList().begin();
1292 FluxboxWindow::ClientList::iterator client_it_end = win->clientList().end();
1293 for (; client_it != client_it_end; ++client_it) {
1294 WinClient::TransientList::const_iterator it = (*client_it)->transientList().begin();
1295 WinClient::TransientList::const_iterator it_end = (*client_it)->transientList().end();
1296 for (; it != it_end; ++it) {
1297 if ((*it)->fbwindow())
1298 sendToWorkspace(id, (*it)->fbwindow(), false);
1299 }
1288 } 1300 }
1289 1301
1290} 1302}