diff --git a/src/activation.cpp b/src/activation.cpp index f532f8680b..205949e133 100644 --- a/src/activation.cpp +++ b/src/activation.cpp @@ -458,7 +458,7 @@ bool Workspace::activateNextClient(AbstractClient* c) AbstractClient* get_focus = nullptr; - const int desktop = VirtualDesktopManager::self()->current(); + VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop(); if (!get_focus && showingDesktop()) get_focus = findDesktop(true, desktop); // to not break the state @@ -482,7 +482,7 @@ bool Workspace::activateNextClient(AbstractClient* c) } if (!get_focus) { // nope, ask the focus chain for the next candidate - get_focus = FocusChain::self()->nextForDesktop(c, desktop); + get_focus = FocusChain::self()->nextForDesktop(c, desktop->x11DesktopNumber()); } } @@ -505,8 +505,8 @@ void Workspace::setCurrentScreen(int new_screen) if (!options->focusPolicyIsReasonable()) return; closeActivePopup(); - const int desktop = VirtualDesktopManager::self()->current(); - AbstractClient *get_focus = FocusChain::self()->getForActivation(desktop, new_screen); + VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop(); + AbstractClient *get_focus = FocusChain::self()->getForActivation(desktop->x11DesktopNumber(), new_screen); if (get_focus == nullptr) get_focus = findDesktop(true, desktop); if (get_focus != nullptr && get_focus != mostRecentlyActivatedClient()) diff --git a/src/layers.cpp b/src/layers.cpp index a90b75cc68..a518159058 100644 --- a/src/layers.cpp +++ b/src/layers.cpp @@ -245,7 +245,7 @@ AbstractClient *Workspace::topClientOnDesktop(VirtualDesktop *desktop, int scree return nullptr; } -AbstractClient* Workspace::findDesktop(bool topmost, int desktop) const +AbstractClient *Workspace::findDesktop(bool topmost, VirtualDesktop *desktop) const { // TODO Q_ASSERT( block_stacking_updates == 0 ); if (topmost) { diff --git a/src/workspace.cpp b/src/workspace.cpp index 24feed27e0..ccc505259d 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -434,7 +434,7 @@ void Workspace::initializeX11() if (new_active_client == nullptr) new_active_client = topClientOnDesktop(VirtualDesktopManager::self()->currentDesktop(), -1); if (new_active_client == nullptr) - new_active_client = findDesktop(true, VirtualDesktopManager::self()->current()); + new_active_client = findDesktop(true, VirtualDesktopManager::self()->currentDesktop()); } if (new_active_client != nullptr) activateClient(new_active_client); @@ -716,7 +716,7 @@ void Workspace::addClient(X11Client *c) raiseClient(c); // If there's no active client, make this desktop the active one if (activeClient() == nullptr && should_get_focus.count() == 0) - activateClient(findDesktop(true, VirtualDesktopManager::self()->current())); + activateClient(findDesktop(true, VirtualDesktopManager::self()->currentDesktop())); } c->checkActiveModal(); checkTransients(c->window()); // SELI TODO: Does this really belong here? @@ -1073,7 +1073,7 @@ void Workspace::activateClientOnNewDesktop(uint desktop) c = active_client; if (!c) - c = findDesktop(true, desktop); + c = findDesktop(true, VirtualDesktopManager::self()->desktopForX11Id(desktop)); if (c != active_client) setActiveClient(nullptr); @@ -1187,7 +1187,7 @@ void Workspace::updateCurrentActivity(const QString &new_activity) c = active_client; if (!c) - c = findDesktop(true, VirtualDesktopManager::self()->current()); + c = findDesktop(true, VirtualDesktopManager::self()->currentDesktop()); if (c != active_client) setActiveClient(nullptr); diff --git a/src/workspace.h b/src/workspace.h index c0b541e5c2..9381b38a86 100644 --- a/src/workspace.h +++ b/src/workspace.h @@ -277,7 +277,7 @@ public: AbstractClient *topClientOnDesktop(VirtualDesktop *desktop, int screen, bool unconstrained = false, bool only_normal = true) const; - AbstractClient* findDesktop(bool topmost, int desktop) const; + AbstractClient *findDesktop(bool topmost, VirtualDesktop *desktop) const; void sendClientToDesktop(AbstractClient* c, int desktop, bool dont_activate); void windowToPreviousDesktop(AbstractClient* c); void windowToNextDesktop(AbstractClient* c);