Bug 463539

Summary: Rotate digitizer input scheme together with screen (x11/wayland)
Product: [Applications] systemsettings Reporter: Nikolai Försterling <devel2020>
Component: kcm_tabletAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: aleixpol, nate, nicolas.fella
Priority: NOR Keywords: wayland-only
Version First Reported In: 5.25.5   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 5.26
Sentry Crash Report:

Description Nikolai Försterling 2022-12-28 00:19:51 UTC
SUMMARY
***
If you have a laptop, which has a proper sensor to detect orientation (therefore screen rotation works here with wayland), it would be an advantage/nice/desirable/logical/needed/etc., if the builtin digitizer (Wacom HID) would rotate as well as the display does if you turn your laptop.
***

STEPS TO REPRODUCE
1. login to x11 session you can specify rotation of the tablet, but not of the screen and vice versa

OBSERVED RESULT
Automatic screen rotation works, but the digitizer doesn't do as well, so that all apps (e.g. Xournal++) relying on tablet input can't be used as intended.

EXPECTED RESULT
Digitizer input layout should rotate together with the screen so that it fits together.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 22.04 (with kubuntu-backports enabled), Kernel 5.15.0-56-generic 
KDE Plasma Version: Plasma 5.25.5
KDE Frameworks Version: 5.98
Qt Version: 5.15.3

ADDITIONAL INFORMATION
iio_sensor_proxy is active on Acer Spin SP313-51N
In Wayland sessions, the settings-tab for the tablet says it's just for X11 sessions, whereas screen rotation for the display in the corresponding settings-tab isn't available.
In X11 sessions, there's no option for screen rotation in display setting, but the tablet can be configured to rotate.

$ xsetwacom --version
1.0.0
$ xsetwacom --list
Wacom HID 49AF Pen stylus               id: 9   type: STYLUS
Wacom HID 49AF Finger touch             id: 10  type: TOUCH
Wacom HID 49AF Pen eraser               id: 17  type: ERASER
Comment 1 Bug Janitor Service 2022-12-28 00:33:31 UTC
Thank you for the bug report!

Please note that Plasma 5.25.5 is not supported for much longer by KDE; supported versions are 5.24, and 5.26 or newer.

If at all possible please upgrade to a supported version and verify that the bug is still happening there.

If you're unsure how to do this, contact your distributor about it.
Comment 2 Nikolai Försterling 2022-12-28 00:49:14 UTC
(In reply to Bug Janitor Service from comment #1)
> Please note that Plasma 5.25.5 is not supported for much longer by KDE;
> supported versions are 5.24, and 5.26 or newer.
This issue has been present with 5.24, too.
> If at all possible please upgrade to a supported version and verify that the
> bug is still happening there.
5.26 would currently only be available with a development version of Kubuntu or eventually will be upgraded via Backports.
> If you're unsure how to do this, contact your distributor about it.
I'd really like to stay on an LTS version of Kubuntu (for obvious reasons)
Comment 3 Nikolai Försterling 2022-12-28 23:49:19 UTC
I just double-checked some things.
On original Jammy (now on 5.24.7 with updates) there wasn't even a change of the display resolution possible under wayland and due to some compatibility issues with e.g syncthing-gtk and claws-mail i decided to go with x11 instead of wayland.
After some time i added the backports and backports-extra ppa, but forgot to activate the first one.
When I made up for it, there's a new item ("digitizer tablet") beside "graphics tablet" (which still says "just under x11") under input devices that seems to care about rotating like the screen.
And that really works (under wayland plasma 5.25.5).
So just left to do/fix seems to be activating rotating in the screen settings under x11 (change bug to component kcm_kscreen?)
Comment 4 Nate Graham 2023-01-06 21:27:07 UTC
Unfortunately this can't work on X11 for technical reasons. It already works on Wayland in version 5.26 and later.
Comment 5 Nikolai Försterling 2023-01-08 12:17:13 UTC
(In reply to Nate Graham from comment #4)
> Unfortunately this can't work on X11 for technical reasons. 
Could you point me to some detailed reason? As X11 can rotate manually, i assumed that it would be possible automatically as well.
> It already works on Wayland in version 5.26 and later.
So for the next few years, i'll have to decide at login screen choosing a session type if i want to use rotating on my tablet (and accept flaws in several programs with wayland) or use anything else without the ability to rotate. 
Not ideal, but i could deal with that.
Comment 6 Nate Graham 2023-01-09 16:58:07 UTC
It was an internal KWin issue that made it not technically feasible to implement on X11 IIRC.
Comment 7 Nicolas Fella 2023-01-11 13:29:05 UTC
> Unfortunately this can't work on X11 for technical reasons. It already works on Wayland in version 5.26 and later.

What exactly are you referring to? Automatically rotating the screen based on device orientation or rotating tablet input based on the screen orientation?

KWin isn't really involved with tablet input on X11, it's all managed by https://invent.kde.org/system/wacomtablet. It's probably doable for it to rotate the tablet based on the screen rotation (I say probably because I haven't thought about it more than 5 minutes)