Simplify Workspace::sendClientToDesktop()
This allows changing the type of desk to QVector<VirtualDesktop *>. Based on the dont_activate flag, Workspace::sendClientToDesktop() will try to focus the window if it's moved to the current virtual desktop. In order to implement that, it needs to know whether the window has been on the current desktop. c->isOnDesktop(desk) is a much sophisticated way to do that.
This commit is contained in:
parent
2e0336681f
commit
1fbd99b572
1 changed files with 2 additions and 2 deletions
|
@ -1261,7 +1261,7 @@ void Workspace::sendClientToDesktop(AbstractClient* c, int desk, bool dont_activ
|
|||
if ((desk < 1 && desk != NET::OnAllDesktops) || desk > static_cast<int>(VirtualDesktopManager::self()->count()))
|
||||
return;
|
||||
int old_desktop = c->desktop();
|
||||
bool was_on_desktop = c->isOnDesktop(desk) || c->isOnAllDesktops();
|
||||
const bool wasOnCurrent = c->isOnCurrentDesktop();
|
||||
c->setDesktop(desk);
|
||||
if (c->desktop() != desk) // No change or desktop forced
|
||||
return;
|
||||
|
@ -1269,7 +1269,7 @@ void Workspace::sendClientToDesktop(AbstractClient* c, int desk, bool dont_activ
|
|||
|
||||
if (c->isOnCurrentDesktop()) {
|
||||
if (c->wantsTabFocus() && options->focusPolicyIsReasonable() &&
|
||||
!was_on_desktop && // for stickyness changes
|
||||
!wasOnCurrent && // for stickyness changes
|
||||
!dont_activate)
|
||||
requestFocus(c);
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue