Bug 454413 - Transition from Alt+Tab to Alt+Grave without releasing Alt unexpectedly switches windows
Summary: Transition from Alt+Tab to Alt+Grave without releasing Alt unexpectedly switc...
Status: RESOLVED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: tabbox (show other bugs)
Version: 6.1.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-26 01:00 UTC by RedBearAK
Modified: 2024-07-16 19:12 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RedBearAK 2022-05-26 01:00:36 UTC
Alt+Tab and Alt+Grave shortcuts, when used separately by themselves, perform no action until the Alt key is released. User can "cycle" through any number of windows before releasing the Alt key with either shortcut. The chosen window is finally raised only when the user releases the Alt key. Escape will cancel out of the task switcher/action. 

Transitioning from Alt+Tab to Alt+Grave without releasing Alt currently produces an immediate window raise/activation event, before Alt is released. This is undesirable and contrary to the behavior of these shortcuts when used separately. 

STEPS TO REPRODUCE
1. Open up at least two different applications, with at least two windows of each app open. 

2. Change task switcher settings to clarify what is happening: 
    - Disable "Show selected window"
    - Visualization: "Large Icons"
    - Enable "Only one window per application"

3. Press Alt+Tab and release Tab, but keep Alt held down. 
    Result: 
    - The selected icon in the task switcher dialog is the "other" app that doesn't have focus. 
    - No window of the other app has actually been activated/raised. 
    - As long as Alt is held down, the task switcher dialog remains visible. 
    - User can hit Tab any number of times, no window will be raised until Alt is released. 

4. Still holding down the Alt key from previous step, now tap the Grave key above Tab. Keep Alt held down. 
    Result: 
    - One window of the "other" app is immediately raised, even though Alt is still held down. (Not normal or expected!)
    - Subsequent presses of Grave while holding Alt produce no action until Alt is released. (Normal.)

5. Release Alt, then press Alt+Grave and hold Alt again. 
    Result: 
    - Task switcher dialog shows only the windows of the current "app". 
    - No window is raised/activated until the user releases Alt. 
    - Grave can be pressed many times prior to releasing Alt, without performing an action. 
    - Window action results ONLY from releasing the Alt key. 


EXPECTED RESULT

When transitioning (without releasing Alt) between Alt+Tab (Tab pressed any number of times), which produces no action until Alt is released, to Alt+Grave, which also normally produces no final action until Alt is released, the expected behavior is: 

- No window is immediately raised until Alt is released. 
- Task switcher dialog changes, as it normally does, from showing all windows (or a single large icon for each "application" with "Large Icons" visualizer and "Only one window per application" enabled) to showing just the windows/thumbnails/icons of the application that was highlighted in the task switcher after pressing Alt+Tab. 

Repeat: Alt+Tab to Alt+Grave without releasing Alt should result in the user moving through representations in the task switcher of the application that had an icon HIGHLIGHTED in the task switcher after the last Alt+Tab. 

User should be able to transition back and forth between Alt+Tab and Alt+Grave as many times as they like, without any window raise/activation action ever occurring until Alt is finally released. Or until they hit Escape to cancel the task switcher dialog/action entirely. 


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon and Fedora 36 KDE spin
(available in About System)
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.4
Comment 1 RedBearAK 2024-07-15 22:41:18 UTC
This is still happening in Plasma 6, and it's very easy to confirm. 

It must happen because the tab box wants to focus the target window before letting the user walk through the windows of the "current application". But it should be possible to walk through the thumbnails of the target app before focusing it. 

Unfortunately the bug about shortcuts in the "Alternative" tab continuing to use the tab box UI choice from the "Main" tab still remains, and just shows me my main UI of "Large Icons" for Alt+Grave, unless I release the Alt key in between, then Alt+Grave will show me the alternative UI of "Thumbnail Grid".
Comment 2 David Edmundson 2024-07-16 11:11:50 UTC
I can confirm this is how it behaves, I also don't see it as a bad thing, the user has caused an explicit action to switch from switch between all windows and windows of that app.

I bet we would get some complaints if we changed it.
Comment 3 RedBearAK 2024-07-16 19:12:10 UTC
(In reply to David Edmundson from comment #2)
> I can confirm this is how it behaves, I also don't see it as a bad thing,
> the user has caused an explicit action to switch from switch between all
> windows and windows of that app.
> 
> I bet we would get some complaints if we changed it.

I'm not going to re-open this, but I will point out for now that the behavior of switching immediately **_without releasing the modifier key_** is not how almost any other desktop operating system or Linux desktop environment does task switching. Which is what makes it "unexpected". 

I can see that with the way the tab box behavior is currently designed (which also causes the other bug I mentioned, that would have to be fixed to make moving from Alt+Tab to Alt+Grave without releasing Alt make any sense) this is unlikely to be resolvable with a simple bug fix. 

The KDE community would need to be convinced that the whole tab box behavior in general needs to be revamped, so that it would be possible to choose different styles of task switching entirely.