Bug 443452 - [Wayland] Cursor position is offset when going over various actions on multi monitor and multi scaling setup
Summary: [Wayland] Cursor position is offset when going over various actions on multi ...
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.22.90
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-07 21:33 UTC by Tony Stipanic
Modified: 2021-10-13 13:07 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Phone recording of mouse cursor bug (2.96 MB, video/mp4)
2021-10-07 21:36 UTC, Tony Stipanic
Details
Wayland Firefox debug logs (1.70 MB, text/plain)
2021-10-13 08:48 UTC, Tony Stipanic
Details
qdbus kwin output (6.82 KB, text/plain)
2021-10-13 09:30 UTC, Tony Stipanic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Stipanic 2021-10-07 21:33:13 UTC
SUMMARY
When having a multi monitor setup with at least two monitors which both have different scaling, the cursor seems to not keep the offset correctly. When hovering over various actions like links, draggable lines, etc. the offset always changes. This only happens to one of two monitors. For example, if one monitor is scaled 200%, no jumping happens. But trying to use a 100% second monitor makes the cursor jump a lot.

This seems to be a lot worse for the user using the monitor. When trying to record the screen, the recording seems to be less severe. For this reason, there is a phone recording to show the effect better.

This happens on Wayland. The jumping happens on both XWayland as well as Native Wayland programs.

STEPS TO REPRODUCE
1. Have one monitor be scaled 200% (for example HIDPI monitor). Have the other monitor be scaled 100% (non-HIDPI).
2. Open any program - easiest to test with Firefox on a website
3. Move the mouse around on a non-HIDPI monitor.

OBSERVED RESULT
The mouse jumps around and you can click on objects the mouse isn't visually on.

EXPECTED RESULT
The cursor doesn't jump around. For example when moving down, the cursor only moves on the y-axis.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Endeavour OS, using kde-unstable repo
KDE Plasma Version: 5.22.90
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
None
Comment 1 Tony Stipanic 2021-10-07 21:36:17 UTC
Created attachment 142243 [details]
Phone recording of mouse cursor bug
Comment 2 Vlad Zahorodnii 2021-10-08 06:25:28 UTC
> Move the mouse around on a non-HIDPI monitor
Is the window on both hidpi and non-hidpi monitors? Can you also please run a native wayland program with WAYLAND_DEBUG=1 envvar and post the log output here?
Comment 3 Tony Stipanic 2021-10-08 13:57:25 UTC
No, the window is only on the non-HIDPI monitor. It does not eclipse the other monitor. You can use see this happening on programs like Dolphin too, if that helps.

I'm going to bring logs soon
Comment 4 Tony Stipanic 2021-10-13 08:44:37 UTC
Sorry for the delay, I have attached the logs with the debug env var. I have opened firefox and was on the page https://bugs.kde.org/buglist.cgi?chfield=%5BBug%20creation%5D&chfieldfrom=7d&list_id=1920021 similar to how it is on the video. I can give further logs for other programs if desired.
Comment 5 Tony Stipanic 2021-10-13 08:48:29 UTC
Created attachment 142384 [details]
Wayland Firefox debug logs
Comment 6 Vlad Zahorodnii 2021-10-13 09:25:30 UTC
I don't see anything suspicious in the wayland debug log. What video card do you have?
Comment 7 Vlad Zahorodnii 2021-10-13 09:28:26 UTC
Also, is the output rotated? Can you please post output of `qdbus org.kde.KWin /KWin supportInformation`?
Comment 8 Tony Stipanic 2021-10-13 09:30:57 UTC
Created attachment 142388 [details]
qdbus kwin output
Comment 9 Tony Stipanic 2021-10-13 09:32:43 UTC
Attached the qdbus output.

I'm currently running on Intel(R) UHD Graphics 620
The laptop itself does have a Nvidia chip, but it has been currently blacklisted and no Nvidia drivers are currently installed. The state for the DGPU is also at D3cold, so it's not running right now
Comment 10 Vlad Zahorodnii 2021-10-13 09:44:51 UTC
What if you change the cursor theme to something else, e.g. dmz or adwaita? Can you still reproduce the issue?
Comment 11 Tony Stipanic 2021-10-13 09:57:25 UTC
Yes, it also happens with other cursor themes. Tried it with Adawita, Oxygen and a different Breeze style
Comment 12 Vlad Zahorodnii 2021-10-13 09:59:58 UTC
That's weird. It might be a hardware bug. If you flip scale factors, i.e. laptop display -> x1, external monitor -> x2, does the cursor still jump?
Comment 13 Tony Stipanic 2021-10-13 10:18:38 UTC
Interesting, the mouse cursor still jumps around at flipped scale factors. It also seems like at 200% on external monitor, there's more of a tendency to have the cursor cut off
Comment 14 Vlad Zahorodnii 2021-10-13 10:26:51 UTC
Another thing that's worth checking is whether the cursor jumps with software cursor.

Software cursor can be forced by adding KWIN_FORCE_SW_CURSOR=1 to /etc/environment and rebooting the computer.
Comment 15 Tony Stipanic 2021-10-13 10:30:19 UTC
This seems to have helped. The cursor is not jumping around anymore when using KWIN_FORCE_SW_CURSOR=1
Comment 16 Vlad Zahorodnii 2021-10-13 11:05:08 UTC
Can you reproduce this bug in Plasma 5.22?
Comment 17 Vlad Zahorodnii 2021-10-13 11:05:50 UTC
`sudo pacman -S extra/kdecoration extra/kwayland-server extra/kwin` should be enough
Comment 18 Tony Stipanic 2021-10-13 12:55:18 UTC
Using the command to downgrade, it seems to be very similar to the bug 433436 marked as "see also". It still jumps but reverts to the right position instead of being stuck in a offset
Comment 19 Vlad Zahorodnii 2021-10-13 13:07:07 UTC
It appears like an issue either in the driver or hardware. Neither can be fixed in kwin. As a workaround, you can force software cursor rendering.

I recommend to report this issue to intel driver developers. https://gitlab.freedesktop.org/drm/intel/-/issues/