diff --git a/src/activation.cpp b/src/activation.cpp index 53bfe42fc6..20e0e5decd 100644 --- a/src/activation.cpp +++ b/src/activation.cpp @@ -814,9 +814,7 @@ enum Level { } // focus_in -> the window got FocusIn event -// ignore_desktop - call comes from _NET_ACTIVE_WINDOW message, don't refuse just because of window -// is on a different desktop -bool X11Window::allowWindowActivation(xcb_timestamp_t time, bool focus_in, bool ignore_desktop) +bool X11Window::allowWindowActivation(xcb_timestamp_t time, bool focus_in) { auto window = this; // options->focusStealingPreventionLevel : @@ -860,11 +858,6 @@ bool X11Window::allowWindowActivation(xcb_timestamp_t time, bool focus_in, bool return false; } - // Desktop switching is only allowed in the "no protection" case - if (!ignore_desktop && !window->isOnCurrentDesktop()) { - return false; // allow only with level == 0 - } - // No active window, it's ok to pass focus // NOTICE that extreme protection needs to be handled before to allow protection on unmanged windows if (ac == nullptr || ac->isDesktop()) { @@ -881,10 +874,6 @@ bool X11Window::allowWindowActivation(xcb_timestamp_t time, bool focus_in, bool return true; } - if (!window->isOnCurrentDesktop()) { // we allowed explicit self-activation across virtual desktops - return false; // inside a window or if no window was active, but not otherwise - } - // High FPS, not intr-window change. Only allow if the active window has only minor interest if (level > FSP::Medium && protection > FSP::Low) { return false; diff --git a/src/netinfo.cpp b/src/netinfo.cpp index e93c84d44a..c37c9203ba 100644 --- a/src/netinfo.cpp +++ b/src/netinfo.cpp @@ -163,12 +163,12 @@ void RootInfo::changeActiveWindow(xcb_window_t w, NET::RequestSource src, xcb_ti return; // WORKAROUND? With > 1 plasma activities, we cause this ourselves. bug #240673 } else { // NET::FromApplication X11Window *c2; - if (c->allowWindowActivation(timestamp, false, true)) { + if (c->allowWindowActivation(timestamp, false)) { workspace->activateWindow(c); // if activation of the requestor's window would be allowed, allow activation too } else if (active_window != XCB_WINDOW_NONE && (c2 = workspace->findClient(Predicate::WindowMatch, active_window)) != nullptr - && c2->allowWindowActivation(timestampCompare(timestamp, c2->userTime() > 0 ? timestamp : c2->userTime()), false, true)) { + && c2->allowWindowActivation(timestampCompare(timestamp, c2->userTime() > 0 ? timestamp : c2->userTime()), false)) { workspace->activateWindow(c); } else { c->demandAttention(); diff --git a/src/x11window.h b/src/x11window.h index d67342d340..516d40a842 100644 --- a/src/x11window.h +++ b/src/x11window.h @@ -301,8 +301,7 @@ public: void handleSync(); void handleSyncTimeout(); - bool allowWindowActivation(xcb_timestamp_t time = -1U, bool focus_in = false, - bool ignore_desktop = false); + bool allowWindowActivation(xcb_timestamp_t time = -1U, bool focus_in = false); static void cleanupX11();