diff options
Diffstat (limited to 'src/Window.cc')
-rw-r--r-- | src/Window.cc | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/src/Window.cc b/src/Window.cc index 41cc07d..4801f12 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -1376,9 +1376,8 @@ bool FluxboxWindow::focus() { | |||
1376 | 1376 | ||
1377 | FluxboxWindow *cur = FocusControl::focusedFbWindow(); | 1377 | FluxboxWindow *cur = FocusControl::focusedFbWindow(); |
1378 | WinClient *client = FocusControl::focusedWindow(); | 1378 | WinClient *client = FocusControl::focusedWindow(); |
1379 | if (cur && client && cur != this && | 1379 | if (cur && client && cur != this && cur->isFullscreen() && |
1380 | getRootTransientFor(m_client) != getRootTransientFor(client) && | 1380 | getRootTransientFor(m_client) != getRootTransientFor(client)) |
1381 | (cur->isFullscreen() || cur->isTyping())) | ||
1382 | return false; | 1381 | return false; |
1383 | 1382 | ||
1384 | if (isIconic()) { | 1383 | if (isIconic()) { |
@@ -2315,26 +2314,33 @@ void FluxboxWindow::mapRequestEvent(XMapRequestEvent &re) { | |||
2315 | // Note: this function never gets called from WithdrawnState | 2314 | // Note: this function never gets called from WithdrawnState |
2316 | // initial state is handled in restoreAttributes() and init() | 2315 | // initial state is handled in restoreAttributes() and init() |
2317 | 2316 | ||
2317 | // if the user doesn't want the window, then ignore request | ||
2318 | if (!allowsFocusFromClient()) | ||
2319 | return; | ||
2320 | |||
2321 | setCurrentClient(*client, false); // focus handled on MapNotify | ||
2322 | deiconify(false); | ||
2323 | |||
2324 | } | ||
2325 | |||
2326 | bool FluxboxWindow::allowsFocusFromClient() { | ||
2327 | |||
2318 | // check what to do if window is on another workspace | 2328 | // check what to do if window is on another workspace |
2319 | if (screen().currentWorkspaceID() != workspaceNumber() && !isStuck()) { | 2329 | if (screen().currentWorkspaceID() != workspaceNumber() && !isStuck()) { |
2320 | menu().hide(); | 2330 | BScreen::FollowModel model = screen().getFollowModel(); |
2321 | BScreen::FollowModel model = screen().getUserFollowModel(); | ||
2322 | if (model == BScreen::IGNORE_OTHER_WORKSPACES) | 2331 | if (model == BScreen::IGNORE_OTHER_WORKSPACES) |
2323 | return; | 2332 | return false; |
2324 | // fetch the window to the current workspace | ||
2325 | if (model == BScreen::FETCH_ACTIVE_WINDOW || | ||
2326 | (isIconic() && model == BScreen::SEMIFOLLOW_ACTIVE_WINDOW)) | ||
2327 | screen().sendToWorkspace(screen().currentWorkspaceID(), this, true); | ||
2328 | // warp to the workspace of the window | ||
2329 | else | ||
2330 | screen().changeWorkspaceID(workspaceNumber()); | ||
2331 | } | 2333 | } |
2332 | 2334 | ||
2333 | setCurrentClient(*client, false); // focus handled on MapNotify | 2335 | FluxboxWindow *cur = FocusControl::focusedFbWindow(); |
2334 | deiconify(false); | 2336 | WinClient *client = FocusControl::focusedWindow(); |
2337 | if (cur && client && cur->isTyping() && | ||
2338 | getRootTransientFor(m_client) != getRootTransientFor(client)) | ||
2339 | return false; | ||
2335 | 2340 | ||
2336 | } | 2341 | return true; |
2337 | 2342 | ||
2343 | } | ||
2338 | 2344 | ||
2339 | void FluxboxWindow::mapNotifyEvent(XMapEvent &ne) { | 2345 | void FluxboxWindow::mapNotifyEvent(XMapEvent &ne) { |
2340 | WinClient *client = findClient(ne.window); | 2346 | WinClient *client = findClient(ne.window); |