From 3f0b4826dd06551ee066d9e94f36d83d8a801cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Tue, 21 Feb 2012 23:55:55 +0100 Subject: [PATCH] - lower windows does not change focus for F(S)UM - lower by shortcut honors nextFocusPrefersMouse setting CCBUG: 80897 REVIEW: 104041 --- useractions.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/useractions.cpp b/useractions.cpp index 5b74e2e2c5..7614c72608 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -820,7 +820,7 @@ bool Client::performMouseCommand(Options::MouseCommand command, const QPoint &gl workspace()->lowerClient(this); // used to be activateNextClient(this), then topClientOnDesktop // since this is a mouseOp it's however safe to use the client under the mouse instead - if (isActive()) { + if (isActive() && options->focusPolicyIsReasonable()) { Client *next = workspace()->clientUnderMouse(screen()); if (next && next != this) workspace()->requestFocus(next, false); @@ -1239,8 +1239,15 @@ void Workspace::slotWindowLower() // As this most likely makes the window no longer visible change the // keyboard focus to the next available window. //activateNextClient( c ); // Doesn't work when we lower a child window - if (active_client->isActive()) - activateClient(topClientOnDesktop(currentDesktop(), -1)); + if (active_client->isActive() && options->focusPolicyIsReasonable()) { + if (options->nextFocusPrefersMouse) { + Client *next = clientUnderMouse(active_client->screen()); + if (next && next != active_client) + requestFocus(next, false); + } else { + activateClient(topClientOnDesktop(currentDesktop(), -1)); + } + } } }