Bug 509516

Summary: Hi-res scroll events aren't passed through to nested kwin-wayland
Product: [Plasma] kwin Reporter: André M <andre.vmatos>
Component: platform-wayland-nestedAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: minor CC: kde, nate, poeticrpm, xaver.hugl
Priority: NOR    
Version First Reported In: 6.4.5   
Target Milestone: ---   
Platform: NixOS   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description André M 2025-09-15 12:19:43 UTC
SUMMARY
I'm running NixOS unstable plasma 6.4.5 on host, and another NixOS unstable systemd-nspawn container, to which I bind wayland socket, export WAYLAND_DISPLAY in the container, and startplasma-wayland a full nested plasma session; desktop shows up in a nested window, which I make fullscreen and disable global shortcuts in host (so it receives all inputs when focused); I can still go back to host by switching desktops with 3-finger gesture; it works surprisingly well, except for some smaller issues:

In this case, when looking at kwin's console Input Events, I can see both Delta=15, Delta(V120)=120 events when scrolling; but if check in the nested kwin, I see Delta=15, Delta(V120)=0
Most apps work fine with just the low-res events, but some (e.g. Zed Editor) look only at the V120, and scroll doesn't work.

STEPS TO REPRODUCE
1. Launch nested kwin session
2. Open kwin debug console
3. Check Delta(V120)=0 for scroll events

OBSERVED RESULT
Delta(V120) (hi-res scrolling events) are passed as 0

EXPECTED RESULT
Events are passed as is

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.4.5
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.2

ADDITIONAL INFORMATION
I'm using a Logitech MX Anywhere 3S mouse over bluetooth, which is supposed to have hi-res scroll, but I never managed to make it detect high resolution support (as per libinput debug-events)
Comment 1 André M 2026-01-08 03:24:41 UTC
I think it may be caused by this?
https://invent.kde.org/plasma/kwin/-/blob/master/src/backends/wayland/wayland_backend.cpp#L139
Comment 2 André M 2026-01-08 11:54:20 UTC
Also (possibly related), cursor hotspots are not passed through correctly; even for default cursor and on breeze cursor theme, it's off horizontally by a few pixels, and non-default cursors are worse
Comment 3 Zamundaaa 2026-01-08 14:06:41 UTC
Yeah, pointer input in the nested backend will have to be ported away from kwayland and support for v120 events added.

The hotspot issue is unrelated.
Comment 4 Bug Janitor Service 2026-01-08 14:07:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8608
Comment 5 Zamundaaa 2026-01-08 16:14:55 UTC
Git commit 859ac3326f781375476ff707584b93a8592f028c by Xaver Hugl.
Committed on 08/01/2026 at 16:14.
Pushed by zamundaaa into branch 'master'.

backends/wayland: fix the cursor hotspot with scaling

The hotspot on `OutputLayer` is in device pixels, but Wayland wants it in
logical coordinates.

M  +1    -1    src/backends/wayland/wayland_egl_backend.cpp

https://invent.kde.org/plasma/kwin/-/commit/859ac3326f781375476ff707584b93a8592f028c
Comment 6 Bug Janitor Service 2026-01-08 16:15:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8611
Comment 7 André M 2026-01-08 18:46:32 UTC
Hi-res scroll events (out of kwayland) would be nice, but a temp workaround/stopgap could be just providing multiplied discrete events, that'd be at least better than 0
Thank you for the hotspot fix, I'll try to compile kwin from master on my NixOS and report back.
Comment 8 Jason 2026-01-09 22:14:22 UTC
I have a similar issue, but I'm not knowledgeable enough about how scrolling works to know whether this bug report addresses the issue or whether I should file a new bug report.

Using KDE on a host, any virtual machine run under virt-manager or boxes has uneven scrolling. So imagine scrolling on a web page: 3 lines -> 6 lines -> 3 lines -> 6 lines, etc. On Gnome virt-manager behaves as it should: 3 lines -> 3 lines -> 3 lines -> 3 lines, etc. I think this is because Gnome (mutter) detects when a client window can use hi-res scrolling and sends through hi-res data when it does- if it doesn't, it uses the legacy means of passing a scroll event. I should note that if I run virt-manager with "GDK_BACKEND=x11 virt-manager" it used to work correctly.

This is a particularly annoying issue (especially when dealing with small text input boxes on web pages) because no alternatives exist for local viewing of VMs (karton isn't really there yet) with anywhere near the featureset. 

Is my issue related to this bug report, or should I file a new one?
Comment 9 Zamundaaa 2026-01-12 16:48:49 UTC
Git commit 863ff48acac21308b25f411818d985c8357f516c by Xaver Hugl.
Committed on 12/01/2026 at 16:16.
Pushed by zamundaaa into branch 'Plasma/6.5'.

backends/wayland: fix the cursor hotspot with scaling

The hotspot on `OutputLayer` is in device pixels, but Wayland wants it in
logical coordinates.


(cherry picked from commit 859ac3326f781375476ff707584b93a8592f028c)

Co-authored-by: Xaver Hugl <xaver.hugl@kde.org>

M  +1    -1    src/backends/wayland/wayland_egl_backend.cpp

https://invent.kde.org/plasma/kwin/-/commit/863ff48acac21308b25f411818d985c8357f516c
Comment 10 Zamundaaa 2026-01-13 21:19:49 UTC
(In reply to Jason from comment #8)
> Is my issue related to this bug report, or should I file a new one?
It's not related to this, and most likely a bug in the app / GTK. But yes, create a new bug report, and attach the output of
> WAYLAND_DEBUG=1 command-to-run-app | grep pointer
+ scrolling a few clicks in the app's window before you close it there.