Bug 433436 - Cursor offset issue
Summary: Cursor offset issue
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.23.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-22 17:46 UTC by spreedwow
Modified: 2023-01-28 14:30 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description spreedwow 2021-02-22 17:46:57 UTC
SUMMARY

On Plasma 5.21.0 there is a bug with the cursor, when I hover on things that change the cursor (e.g. clickable links, textboxes, edges...), for a millisecond it revert to the normal cursor with an offset, which makes some flickering.
The bug affect both Wayland and X11 sessions.

STEPS TO REPRODUCE
1. Move your cursor to texts, edges, anything that change its appearance 
2. Slowly move it around
3. See that it's jumping around

OBSERVED RESULT

The cursor reverts to normal with an offset for a few milliseconds then revert to a normal position

EXPECTED RESULT




SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux , kernel 5.10.16-arch1-1
KDE Plasma Version: 5.21.0
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
GPU: AMD RX 470

ADDITIONAL INFORMATION

As this problem is difficult to explain, I've made videos about it, and screenshots

First video, clickable links in Firefox:
https://www.youtube.com/watch?v=hN8KN1T7LPc

Second video, a slow motion on the edge of a terminal: 
https://www.youtube.com/watch?v=oieiAyT4XBc

Frames where you can clearly see an offset for a very short time:
https://ibb.co/7b7gnPN
https://ibb.co/Z2LNSFJ

Another user reporting the same issue:
https://imgur.com/a/NCEFly6
Comment 1 Nate Graham 2021-02-22 20:41:53 UTC
How odd. I cannot reproduce the issue.
Comment 2 Vlad Zahorodnii 2021-10-07 15:21:02 UTC
Videos are unavailable. Similar to Nate, I cannot reproduce the issue in 5.23. Can you check whether this can be reproduce in 5.23? 5.21 is unsupported.
Comment 3 Vlad Zahorodnii 2021-10-07 15:21:38 UTC
this can be reproduced*
Comment 4 Timothy B 2021-10-08 21:46:26 UTC
I've actually reproduced this in any DE using Manjaro ISO images of their official editions (KDE, GNOME, Xfce) on all the PCs I have around the house, and every single one of them exhibit the same exact behavior. So, my best guess is that this more of an issue with X11 than KWin or a single distro. It's also possible that KWin might be amplifying this effect, which could explain why there are so many reports of this same exact bug from KDE users than any other DE.

I have not yet tried testing for this annoyance on Wayland (GNOME or Plasma), so I can't comment on that until after I get a chance to do the testing.

I posted about the above findings in the Manjaro Forum several months ago, which is worth checking out: https://forum.manjaro.org/t/cursor-flickering-jerks-when-changing-states/60256/
Comment 5 Jacopo Martellini 2021-12-29 14:27:37 UTC
I've been having the same issue for years on different machines and distributions.
The last ones are a LattePanda Delta432 with Debian 11 (Plasma 5.20.5), a Lenovo Y50-70 with an i7 4720HQ and a GTX 960m and an old Asus laptop with an Intel cpu and a GTX 850m with Manjaro 21.2.0 (Plasma, 5.23.4)
Comment 6 Vlad Zahorodnii 2022-01-11 08:33:52 UTC
Can you reproduce the issue when using software cursors? Not sure how to enable software cursor in Xorg, but you can force software cursors in kwin_wayland by setting the KWIN_FORCE_SW_CURSOR=1 environment variable (e.g. in /etc/environment and rebooting the computer, or putting in a profile).
Comment 7 Jacopo Martellini 2022-01-22 16:25:13 UTC
(In reply to Vlad Zahorodnii from comment #6)
> Can you reproduce the issue when using software cursors?

I added a conf file to xorg.conf.d and with the software cursor enabled I can't reproduce the issue.
But with the software cursor everything else is kind of unusable
Comment 8 Jacopo Martellini 2022-01-23 11:59:25 UTC
After some more research I've found this report on reddit, that's even more accurate:
https://www.reddit.com/r/kde/comments/hkkjj3/bug_plasma_5_mouse_cursor_flickers_when_changing/

This is the exact same behavior of my cursor: https://damboy.sytes.net/tmp/cursor.mp4

Also, another interesting thing is that it doesn't happen with some cursor themes, like this: https://store.kde.org/p/999978/
Comment 9 Vlad Zahorodnii 2022-01-25 10:34:03 UTC
(In reply to Jacopo Martellini from comment #7)
> I added a conf file to xorg.conf.d and with the software cursor enabled I
> can't reproduce the issue.

If it's okay with software cursor, it points either to the drm driver or hardware.
Comment 10 Jacopo Martellini 2022-01-30 12:16:08 UTC
(In reply to Vlad Zahorodnii from comment #9)
> (In reply to Jacopo Martellini from comment #7)
> > I added a conf file to xorg.conf.d and with the software cursor enabled I
> > can't reproduce the issue.
> 
> If it's okay with software cursor, it points either to the drm driver or
> hardware.

I don't think it can be the hardware, because I've seen this issue in too many different devices.
I never tried on an AMD based one though.
Maybe it's the drm, but somehow in Kde is way more noticeable than in Gnome or Cinnamon.
Comment 11 Vlad Zahorodnii 2023-01-18 15:00:01 UTC
We pushed some cursor fixes a while ago. Can you check whether the issue is reproducible on 5.26 or 2.27?
Comment 12 Jacopo Martellini 2023-01-18 15:31:07 UTC
(In reply to Vlad Zahorodnii from comment #11)
> We pushed some cursor fixes a while ago. Can you check whether the issue is
> reproducible on 5.26 or 2.27?

I'm not on Linux right *now*, but I checked a couple of days ago on a fairly updated Manjaro and the issue was still there.
I'll test again and update the thread by Monday
Comment 13 Jacopo Martellini 2023-01-22 14:22:09 UTC
Hello, I just checked on an up to date Manjaro with Plasma 5.26.4 and the issue is still there.
The system is an old-ish Asus P553UA with an i3 6006u and 4 gb of ram.
In the next week or so I'll test a Ryzen 7000 and I expect to not encounter this issue, but I'll let you know
Comment 14 Vlad Zahorodnii 2023-01-23 10:34:42 UTC
In that case, given all the observations above, it seems like a driver issue. Please report this issue to driver (amdgpu) developers.
Comment 15 Jacopo Martellini 2023-01-23 12:14:44 UTC
(In reply to Vlad Zahorodnii from comment #14)
> In that case, given all the observations above, it seems like a driver
> issue. Please report this issue to driver (amdgpu) developers.

Perhaps I misspoke, I meant to say that so far I have only seen the problem on Intel, while on AMD (or Nvidia) I expect it to not occur on.
I too would be inclined to think it's a bug in the Intel drivers, but it doesn't show up on Gtk desktops, so I wonder what they do differently?
Comment 16 Timothy B 2023-01-23 16:22:43 UTC
(In reply to Vlad Zahorodnii from comment #14)
> In that case, given all the observations above, it seems like a driver
> issue. Please report this issue to driver (amdgpu) developers.
It looks like an issue for this exact bug has already been submitted in the AMDGPU repository last year: https://gitlab.freedesktop.org/drm/amd/-/issues/1968. It also mentioned bug #447797, so this ticket is a possible duplicate.
Comment 17 Jacopo Martellini 2023-01-24 14:03:15 UTC
(In reply to Timothy B from comment #16)
> (In reply to Vlad Zahorodnii from comment #14)
> > In that case, given all the observations above, it seems like a driver
> > issue. Please report this issue to driver (amdgpu) developers.
> It looks like an issue for this exact bug has already been submitted in the
> AMDGPU repository last year:
> https://gitlab.freedesktop.org/drm/amd/-/issues/1968. It also mentioned bug
> #447797, so this ticket is a possible duplicate.

If the same thing happens both on intel and amd, couldn't it be kwin doing something strange?
Comment 18 Timothy B 2023-01-24 14:20:30 UTC
(In reply to Jacopo Martellini from comment #17)
> (In reply to Timothy B from comment #16)
> > (In reply to Vlad Zahorodnii from comment #14)
> > > In that case, given all the observations above, it seems like a driver
> > > issue. Please report this issue to driver (amdgpu) developers.
> > It looks like an issue for this exact bug has already been submitted in the
> > AMDGPU repository last year:
> > https://gitlab.freedesktop.org/drm/amd/-/issues/1968. It also mentioned bug
> > #447797, so this ticket is a possible duplicate.
> 
> If the same thing happens both on intel and amd, couldn't it be kwin doing
> something strange?

I don't really think KWin is at fault here, since I was able to reproduce this exact behavior with other DEs and compositors. I'm betting it has to do with the DRM/DRI
Comment 19 Jacopo Martellini 2023-01-24 14:59:10 UTC
(In reply to Timothy B from comment #18)
> (In reply to Jacopo Martellini from comment #17)
> > (In reply to Timothy B from comment #16)
> > > (In reply to Vlad Zahorodnii from comment #14)
> > > > In that case, given all the observations above, it seems like a driver
> > > > issue. Please report this issue to driver (amdgpu) developers.
> > > It looks like an issue for this exact bug has already been submitted in the
> > > AMDGPU repository last year:
> > > https://gitlab.freedesktop.org/drm/amd/-/issues/1968. It also mentioned bug
> > > #447797, so this ticket is a possible duplicate.
> > 
> > If the same thing happens both on intel and amd, couldn't it be kwin doing
> > something strange?
> 
> I don't really think KWin is at fault here, since I was able to reproduce
> this exact behavior with other DEs and compositors. I'm betting it has to do
> with the DRM/DRI

Fascinating!
May I ask you how?
Comment 20 Timothy B 2023-01-28 14:30:55 UTC
(In reply to Jacopo Martellini from comment #19)
> Fascinating!
> May I ask you how?
All I did was moving the cursor over window borders and other UI elements where it's expected to change states on different Manjaro editions (KDE, Gnome, XFCE), and I took slow motion videos for each DE. I posted all my findings on the old Manjaro forum, but unfortunately the entire site has been taken down in the past month or so.