Bug 359141 - Custom Alt+` shortcut brings up task switcher, but does not walk through applications
Summary: Custom Alt+` shortcut brings up task switcher, but does not walk through appl...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: tabbox (show other bugs)
Version: 5.5.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 362549 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-02-08 16:27 UTC by jat255
Modified: 2021-06-09 16:39 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.22.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jat255 2016-02-08 16:27:40 UTC
After changing the task switcher to use a custom shortcut, the shortcut works to bring up the task switcher, but does not work to cycle through the tasks. Instead, Alt+Tab will cycle through tasks (once the switcher is open), even though it is not defined as a shortcut.

Reproducible: Always

Steps to Reproduce:
1. kcmshell5 kwintabbox
2. Set Shortcuts for 'All windows' to Forward: "Alt+`" and Reverse: "Alt+~"
3. Press Alt+` or Alt+~

Actual Results:  
Task switcher will open and switch by one application, but further presses will not work. Once the task switcher is open, pressing Alt+Tab or Alt+Shift+Tab will cycle through the applications, even though there are no shortcuts defined that specify these commands.

Expected Results:  
I would expect that after the task switcher opens, the custom shortcuts of Alt+` and Alt+~ would continue to work to cycle through the applications.
Comment 1 Thomas Lübking 2016-02-08 20:10:15 UTC
Seems to fix with the next kwin_x11 restart, ie. we "miss" the "KGlobalAccel::globalShortcutChanged" signal or the linked function is buggy.

Same problem when altering the shortcut from "kcmshell5 keys".

Please check whether this applies for you as well.
Comment 2 jat255 2016-02-08 20:27:21 UTC
Yup, you're right. Running a `kwin_x11 --replace` will get it to work. Unfortunately it appears there's another problem though... While I can cycle through the tasks forward using Alt+`, I cannot go backwards through this list with Alt+~ (Alt+Shift+`). It continues to cycle forward instead when pressing Alt+~.
Comment 3 Thomas Lübking 2016-02-08 23:10:45 UTC
The signal is emitted a dozen times and also when the config dialogs load, but not after actually changing the shortcut. Not yet clear whether it's a bug in kwin or in kglobalaccel.

You'll be facing a bug where resolution of the shifted key doesn't work (most likely for no "special" key, we need to copy the solution recently applied to kshortcut), please file a new bug about this.
Comment 4 jat255 2016-02-09 19:53:28 UTC
I actually reported this bug a while ago, but no one from the KDE seems to have acknowledged it. Do you know of any better way to get it in front of who would know how to fix it?

https://bugs.kde.org/show_bug.cgi?id=349771
Comment 5 Thomas Lübking 2016-02-09 20:18:41 UTC
Reported to the wrong component ;-P

This is likely fixed in 5.5 by either https://git.reviewboard.kde.org/r/124710/ or https://git.reviewboard.kde.org/r/124893/
It may still be an open problem due to https://git.reviewboard.kde.org/r/125786/ (a quick workaround is to restart kglobalaccel5 after the login)

The kcalc completely unrelated bug #350947
Comment 6 Thomas Lübking 2016-02-09 20:21:47 UTC
Ps, what I wanted to say before anything else: it's not the same issue - the shift modified *trigger* works, but the particular unshifting in KWin is broken (and needs a solution borrowed from kglobalaccel)
Comment 7 jat255 2016-02-09 20:54:23 UTC
Ah, okay. Thanks for the info!

Since my plasma version is 5.5.4, I should have those commits on my system, correct (124710 and 124893)?  If that's the case, the "unshifting" of the `/~ key does not seem to be working still.

It also appears that restarting kglobalaccel5 does not help either, in my tests. 

---

Otherwise, the kcalc thing is fixed now anyway. I'll report that on the other bug thread.
Comment 8 Thomas Lübking 2016-02-09 21:44:08 UTC
Actually kglobalaccel 5.16 (sorry messed up between plasma-workspace and frameworks versions...)
Do you mean you can not assign eg. krunner to "Alt+Shift+`" ?
Comment 9 jat255 2016-02-09 22:59:04 UTC
Hmm, so I can assign and use krunner with "Alt+Shift+`". 

When doing this with Kwin's walk through windows (Alt+` as forward and Alt+Shift+` as reverse), I get the following behavior:

 * Single Alt+` press: Kwin advances by one application 
 * Multiple Alt+` presses: Kwin cycles through the windows in the forward direction as expected
 * Single Alt+Shift+` press: Kwin goes back by one application
 * Multiple Alt+Shift+` presses: Kwin goes backwads one time, then cycles through windows in the forward direction
 * Single Alt+` press followed by Alt+Shift+` presses: Kwin goes forward, and continues going forward
 * Single Alt+Shift+` press followed by Alt+` presses: Kwin goes backwards once, then goes forward

Hopefully that clarifies what's happening. It seems as though after the first activation of the shortcut, the shift key is ignored on following presses. Would it help if I recorded a video?
Comment 10 Thomas Lübking 2016-02-09 23:21:13 UTC
Yes, that's a bug in KWin, it needs to fix the unshifting (after the first trigger, kwin takes control over the input and processes it by itself. That's custom X11 level stuff just as in kglobalaccel, where we need to borrow code from - as I may have mentioned ;-)

All is fine.
It's not bug #349771 (which you just confirmed to be fixed), so please file a new bug against KWin, tabbox component (this way you're automatically tracking the issue - plus: you actually found it ;-)
Comment 11 jat255 2016-02-09 23:31:12 UTC
Ok, thanks. Filed here: https://bugs.kde.org/show_bug.cgi?id=359206
Comment 12 Amadeusz Sławiński 2016-05-01 15:28:01 UTC
*** Bug 362549 has been marked as a duplicate of this bug. ***
Comment 13 Alexander Mentyu 2018-09-19 10:50:48 UTC
Can reproduce on Wayland

Before relogin and after setting Alt+` and Alt+~ shortcuts are working only once and after subsequent presses they switching between windows of current application.

Alt+` or Alt+~ shortcuts are working as expected and Alt+Tab and Alt+Shift+Tab shortcuts are stop working only after relogin.
Cycling backwards through all windows when pressing Alt+~ as expected after relogin.

Operating System: KDE neon Developer Edition
KDE Plasma Version: 5.14.80
Qt Version: 5.11.1
KDE Frameworks Version: 5.51.0
Kernel Version: 4.15.0-34-generic
OS Type: 64-bit
Processors: 8 × Intel® Core™ i5-8250U CPU @ 1.60GHz
Memory: 7,7 GiB of RAM
Comment 14 Alexander Mentyu 2018-09-19 11:17:30 UTC
Somewhere in the middle of changing shortcuts and keyboard layouts Alt+Shift+Tab shortcut stopped cycling windows backwards - only task switcher is displayed with current window highlighted after the shortcut triggered
Comment 15 inasprecali 2019-09-19 19:37:32 UTC
I can confirm the same bug on Plasma 5.15.
Comment 16 lilydjwg 2020-11-28 14:36:55 UTC
I still need to run `kwin_x11 --replace` to make my custom keys to cycle through applications with plasma 5.20.3. My key is Ctrl+j / Ctrl+k, without shifts.
Comment 17 Bug Janitor Service 2021-06-04 21:07:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1070
Comment 18 Andrey 2021-06-08 11:51:10 UTC
Git commit 471d635f0c6844cf5b99baa73b2142c9d89d9471 by Andrey Butirsky.
Committed on 08/06/2021 at 11:50.
Pushed by butirsky into branch 'master'.

[tabbox] fix non-working global shortcuts overrides

static cuts[] array was initialized only once with copies of non-const
objects, so when new shortcuts are configured, the old objects were still
referenced.
Fixed by having non-static array instead, so actual objects are copied
on the init every time.

M  +1    -1    src/tabbox/tabbox.cpp

https://invent.kde.org/plasma/kwin/commit/471d635f0c6844cf5b99baa73b2142c9d89d9471
Comment 19 Andrey 2021-06-08 11:53:43 UTC
Git commit c04b2aa367a94a09f8ab036841fd9802a0e55434 by Andrey Butirsky.
Committed on 08/06/2021 at 11:53.
Pushed by butirsky into branch 'Plasma/5.22'.

[tabbox] fix non-working global shortcuts overrides

static cuts[] array was initialized only once with copies of non-const
objects, so when new shortcuts are configured, the old objects were still
referenced.
Fixed by having non-static array instead, so actual objects are copied
on the init every time.


(cherry picked from commit 471d635f0c6844cf5b99baa73b2142c9d89d9471)

M  +1    -1    src/tabbox/tabbox.cpp

https://invent.kde.org/plasma/kwin/commit/c04b2aa367a94a09f8ab036841fd9802a0e55434