Bug 480227

Summary: The active window does not change when pressing other tablet pen buttons than the pen tip button
Product: [Plasma] kwin Reporter: Sebastian Parborg <darkdefende>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 6.1.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Sebastian Parborg 2024-01-23 14:42:12 UTC
SUMMARY

If you have a window focused (if you type on the keyboard the input will end up in that window), and middle mouse click on an other window, the focus will switch as expected.

However if you instead use a tablet and do the equivalent of middle mouse clicking, the click event will be passed to the correct window, but the focus will not change.

This makes it really annoying to use the pen in software like Blender/Krita as you have to first tap with the pen on the window to make it respond to keyboard shortcut.

STEPS TO REPRODUCE
1. Open Krita and draw something.
2. Open a terminal (konsole) and set it to "always on top" and type something in there
3. Use the tablet pen button to pan around in Krita.
4. Without taping with the pen on the Krita window, try to use any shortcuts

OBSERVED RESULT
All key presses ends up in the konsole window, even after explicitly interacting with Krita window.

EXPECTED RESULT
The equivalent of right click and middle mouse click on the tablet pen should focus the window just like it does with the mouse.

This is how it works the Xorg version of Plasma (and also in Gnome X11/Wayland)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo/KDE Plasma 5.92.0
Comment 1 Bug Janitor Service 2024-12-30 21:26:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6954
Comment 2 Nicolas Fella 2025-01-10 19:07:57 UTC
Git commit 232e1fc8e1f2b32c36148507bd782293a05c4078 by Nicolas Fella.
Committed on 10/01/2025 at 18:03.
Pushed by nicolasfella into branch 'master'.

Perform window mouse action for tablet tool buttons

Perform the actions for middle/right click

M  +22   -0    src/input.cpp

https://invent.kde.org/plasma/kwin/-/commit/232e1fc8e1f2b32c36148507bd782293a05c4078
Comment 3 Nicolas Fella 2025-01-10 19:36:14 UTC
Git commit 827f166c8f3188afcbb05295e1130d233877cd8b by Nicolas Fella.
Committed on 10/01/2025 at 19:08.
Pushed by nicolasfella into branch 'Plasma/6.3'.

Perform window mouse action for tablet tool buttons

Perform the actions for middle/right click


(cherry picked from commit 232e1fc8e1f2b32c36148507bd782293a05c4078)

Co-authored-by: Nicolas Fella <nicolas.fella@gmx.de>

M  +22   -0    src/input.cpp

https://invent.kde.org/plasma/kwin/-/commit/827f166c8f3188afcbb05295e1130d233877cd8b