Always keep focus on active client when switching activities
While finding this to be benficial when working on the activity switcher I think it makes sense in general to keep focus on the current client instead of potentially switching away.
This commit is contained in:
parent
dde7a2efac
commit
b1686fd472
1 changed files with 4 additions and 6 deletions
|
@ -1161,15 +1161,13 @@ void Workspace::updateCurrentActivity(const QString &new_activity)
|
|||
AbstractClient* c = nullptr;
|
||||
|
||||
//FIXME below here is a lot of focuschain stuff, probably all wrong now
|
||||
if (options->focusPolicyIsReasonable()) {
|
||||
// Keep active client focused if it's on the new activity
|
||||
if (active_client && active_client->isShown() && active_client->isOnCurrentDesktop() && active_client->isOnCurrentActivity()) {
|
||||
c = active_client;
|
||||
} else if (options->focusPolicyIsReasonable()) {
|
||||
// Search in focus chain
|
||||
c = FocusChain::self()->getForActivation(VirtualDesktopManager::self()->currentDesktop());
|
||||
}
|
||||
// If "unreasonable focus policy" and active_client is on_all_desktops and
|
||||
// under mouse (Hence == old_active_client), conserve focus.
|
||||
// (Thanks to Volker Schatz <V.Schatz at thphys.uni-heidelberg.de>)
|
||||
else if (active_client && active_client->isShown() && active_client->isOnCurrentDesktop() && active_client->isOnCurrentActivity())
|
||||
c = active_client;
|
||||
|
||||
if (!c)
|
||||
c = findDesktop(true, VirtualDesktopManager::self()->currentDesktop());
|
||||
|
|
Loading…
Reference in a new issue