Bug 465858 - shift + drag does not interact with the tiling layout if Both Shifts together enable Caps Lock
Summary: shift + drag does not interact with the tiling layout if Both Shifts together...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: Custom Tiling (show other bugs)
Version: 5.27.0
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 466017 467307 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-02-16 17:46 UTC by Rob
Modified: 2024-04-13 06:51 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rob 2023-02-16 17:46:36 UTC
SUMMARY
***
I use the "Both Shifts together enable Caps Lock" feature (System Settings > Input Devices > Keyboard > Advanced > Compatibility Options) since I also make Caps Lock and additional Hyper.  If this setup is in place, holding Shift makes no difference in window resizing behavior.  Unchecking "Both Shifts together enable Caps Lock" produces the expected behavior.
***


STEPS TO REPRODUCE
1. In System Settings > Input Devices > Keyboard > Advanced > Compatibility Options, check "Both Shifts together enable Caps Lock".
2. Configure a tiling layout with Meta + T.
3. Attempt to drag a window into a tile frame by holding Shift while dragging it.

OBSERVED RESULT
Dragging simply moves the window normally without snapping it to any tile frame.

EXPECTED RESULT
Dragging a window into the tile frame should snap the window into place, resizing it to fit.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
Operating System: Arch Linux 
KDE Plasma Version: 5.27.0
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.1.12-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i5-8250U CPU @ 1.60GHz
Memory: 31.1 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Manufacturer: LENOVO
Product Name: 20L9001NUS
System Version: ThinkPad T580


ADDITIONAL INFORMATION
Un-checking "Both Shifts together enable Caps Lock" reverts to the expected new Custom Tiling behavior when Shift + dragging.  I have observed this on both my ThinkPad T580 and ThinkPad Yoga Gen 2, both running Arch Linux and KDE Plasma 5.27.0. 
Many thanks to all the devs on this S-tier desktop environment!
I can record a screencap video or send console output if requested.
Comment 1 rnet723 2023-02-16 21:10:41 UTC
I confirm, same happens if you have 'Shift cancels Caps Lock' under set under 'Miscellaneous compatibility options'

Plasma 5.27.0, openSUSE Leap 15.4
Comment 2 Nate Graham 2023-02-17 20:48:24 UTC
Wow
Comment 3 Nate Graham 2023-02-17 20:54:10 UTC
Presumably the shift key works normally in most or all other contexts for you, right? Like, you can capitalize letters while typing when you hold down the Shift key, right?

If so, the issue is probably that how KWin is looking for whether the shift key is pressed doesn't match up with how it's done elsewhere, and it's method of doing it causes it to fail when using that specific XKB key remapping option.
Comment 4 rnet723 2023-02-17 21:12:02 UTC
(In reply to Nate Graham from comment #3)
> Presumably the shift key works normally in most or all other contexts for
> you, right? Like, you can capitalize letters while typing when you hold down
> the Shift key, right?
> 
> If so, the issue is probably that how KWin is looking for whether the shift
> key is pressed doesn't match up with how it's done elsewhere, and it's
> method of doing it causes it to fail when using that specific XKB key
> remapping option.

Yes, the Shift key is working normally in most cases: typing, video games. Sometimes modifier keys get 'stuck' when you switch windows, but I think it's another issue that deserves a bug report of its own (one day :). I'm using Wayland session btw, I didn't have a chance to test it in X11 session.
Another case when Shift key does not work right is Krita: it seems it does not get shift release event when you're using a brush or some tool. Disabling shift compatibility action helps it too. Not sure it's same issue with Kwin, or a different issue in Krita.
Comment 5 Nate Graham 2023-02-21 18:12:58 UTC
Wow, ok, can reproduce. I guess there's something unusual about how KWin determines that the Shift key is pressed.
Comment 6 David Edmundson 2023-03-16 21:47:31 UTC
*** Bug 467307 has been marked as a duplicate of this bug. ***
Comment 7 Ilia Pozdnyakov 2023-06-15 14:25:18 UTC
I was experiencing this bug for quite some time now.

Then, after some package updates, I seem to be experiencing an *inverse* of this bug. That is: the "both shifts together enable caps lock" settings is toggled on, but *not* working, and the shift+drag tiling works now!

Should this behavior be filed as a separate bug?

Operating System: Arch Linux 
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.10
Kernel Version: 6.3.8-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i7-11390H @ 3.40GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: Dell Inc.
Product Name: Vostro 15 5510
Comment 8 Zamundaaa 2024-02-13 20:27:16 UTC
*** Bug 466017 has been marked as a duplicate of this bug. ***
Comment 9 Bug Janitor Service 2024-02-13 21:49:52 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5190
Comment 10 Vlad Zahorodnii 2024-02-14 15:32:44 UTC
Git commit 1f1c54ca6cea498fda8c6d14612a4bfd36402c86 by Vlad Zahorodnii, on behalf of Xaver Hugl.
Committed on 14/02/2024 at 14:25.
Pushed by vladz into branch 'master'.

window: use normal keyboard modifiers for triggering custom tiling

Modifiers for global shortcuts are handled differently from normal shortcuts,
because they need to consider modifiers that are consumed by xkb for keyboard
layout transitions and similar. This restriction is not relevant for custom
tiling.

M  +2    -2    src/window.cpp

https://invent.kde.org/plasma/kwin/-/commit/1f1c54ca6cea498fda8c6d14612a4bfd36402c86
Comment 11 Zamundaaa 2024-02-14 17:07:06 UTC
Git commit 160aa7dcbabedd565b9a37f35fd974805cced0a7 by Xaver Hugl.
Committed on 14/02/2024 at 16:39.
Pushed by zamundaaa into branch 'Plasma/6.0'.

window: use normal keyboard modifiers for triggering custom tiling

Modifiers for global shortcuts are handled differently from normal shortcuts,
because they need to consider modifiers that are consumed by xkb for keyboard
layout transitions and similar. This restriction is not relevant for custom
tiling.
(cherry picked from commit 1f1c54ca6cea498fda8c6d14612a4bfd36402c86)

M  +2    -2    src/window.cpp

https://invent.kde.org/plasma/kwin/-/commit/160aa7dcbabedd565b9a37f35fd974805cced0a7
Comment 12 Zamundaaa 2024-02-14 17:12:29 UTC
Git commit fa15cb67d2b21001458aba9e4bb9ef39d5e4c141 by Xaver Hugl.
Committed on 14/02/2024 at 16:41.
Pushed by zamundaaa into branch 'Plasma/5.27'.

window: use normal keyboard modifiers for triggering custom tiling

Modifiers for global shortcuts are handled differently from normal shortcuts,
because they need to consider modifiers that are consumed by xkb for keyboard
layout transitions and similar. This restriction is not relevant for custom
tiling.
(cherry picked from commit 1f1c54ca6cea498fda8c6d14612a4bfd36402c86)

M  +2    -2    src/window.cpp

https://invent.kde.org/plasma/kwin/-/commit/fa15cb67d2b21001458aba9e4bb9ef39d5e4c141
Comment 13 Christian 2024-04-13 06:51:22 UTC
Is there a way to detect what shortcut causes the problem?
I am on openSuse Tumbleweed Plasma 6 and can start the tiling editor but holding shift + moving the window does not work.
I don´t have the mentioned shortcuts enabled, but there seems to be no way to configure the tiling action.