Bug 442902

Summary: "switch to next/previous screen" shortcuts don't work when using "Active screen follows mouse" setting
Product: [Plasma] kwin Reporter: Jason <cuentabasura>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: kde, nate
Priority: NOR Keywords: regression
Version First Reported In: 5.22.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Jason 2021-09-24 16:08:39 UTC
SUMMARY
Shortcuts for switching to next/previous screen don't work. I've tried several combinations (Meta+Alt+Left/Right, Ctrl+Alt+Left/Right) and neither worked.

This was not a problem several versions before. Sorry but I don't remember exactly when this regression was introduced.

I have an external monitor plugged to a laptop through USB-C and used the shortucts to alternate focus between both. I didn't notice problems with any other usual shortcuts, e.g. maximize/minimize or switching windows.

For the record, I have two different keyboard layouts.


SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.22.5
Plasma Framework Version: 5.86.0
Qt Version: 5.15.2
Comment 1 Vlad Zahorodnii 2021-09-24 16:25:31 UTC
There are "Switch to Next/Previous Screen" and "Window to Next/Previous Screen" shortcuts. Is this bug report about "Switch to" shortcuts? Only "Window to" shortcuts are assigned by default.
Comment 2 Jason 2021-09-24 16:39:30 UTC
It's about "switch to next/previous screen". I've tried with different key combos without any result.

Months ago Meta+Alt+Left/Right worked.
Comment 3 Vlad Zahorodnii 2021-09-27 07:46:48 UTC
If you uncheck "Active screen follows mouse" in system settings (window management, window behavior), do the shortcuts start working?
Comment 4 Jason 2021-09-27 10:11:10 UTC
Neat! That did the trick, shortcuts work again.
Comment 5 David Redondo 2021-09-30 12:36:31 UTC
In my testing you need both "Active screen follows unchecked" and "Separate screen focus" checked. 

We use getForActivation to search for a client on the next output

https://invent.kde.org/plasma/kwin/-/blob/master/src/focuschain.cpp#L58

Because of the !m_separateScreenFocus this function actually does not check the outputs and returns the currently focused client (on the current screen)
Comment 6 Nate Graham 2022-09-08 16:27:47 UTC
On a conceptual level, does it make sense to be able to change which screen has focus when "active screen follows mouse" is enabled? If so, you can basically cause a mismatch between them such that the screen the pointer is located on is no longer active. So when happens when you move the mouse again? The active screen immediately jumps back to the screen that has the pointer on it? Or it waits until the pointer moves to another screen and then back? This would get very confusing very fast.

I think this is going to have to be one of those "behaves as expected" things.