Bug 439899

Summary: A second fixed cursor in the center of the screen on top of all sometimes appears.
Product: [Plasma] kwin Reporter: kostyarin <kostyarin.ivanov>
Component: platform-drmAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: eduardo.cruz, plasma-bugs-null, xaver.hugl
Priority: NOR    
Version First Reported In: 5.22.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.23
Sentry Crash Report:
Attachments: Photo
~/.local/share/sddm/wayland-session.log
~/.local/share/sddm/wayland-session.log with debug logs

Description kostyarin 2021-07-15 18:48:35 UTC
Created attachment 140088 [details]
Photo

SUMMARY

Sometimes second mouse cursor appears on screen center. May be it belongs to screen lock or something about it. But, I'm not sure. Ok, the second cursor doesn't move. It say on top off all. It can't be captured by KDE screenshot program. It disappears after reboot.


STEPS TO REPRODUCE
1. Use KDE
2. Give the result

OBSERVED RESULT
- additional mouse cursor on top of all, on screen center

EXPECTED RESULT
- no additional frozen cursors on the screen


SOFTWARE
   Operating System: Arch Linux
   KDE Plasma Version: 5.22.3
   KDE Frameworks Version: 5.84.0
   Qt Version: 5.15.2
   Kernel Version: 5.12.15-arch1-1 (64-bit)
   Graphics Platform: Wayland
   Processors: 4 × Intel® Core™ i5-6200U CPU @ 2.30GHz
   Memory: 15.5 ГиБ of RAM
   Graphics Processor: Mesa Intel® HD Graphics 520/OS VERSIONS


ADDITIONAL INFORMATION

Regular system updates. Also, sometimes a moving cursor becomes black square. I can return it back to normal moving it to Tasks (the bottom panel) and it's ok. May be related.

Attached photo: https://pic4a.ru/17/DI_.jpg
Comment 1 kostyarin 2021-07-16 04:14:35 UTC
Also, switching to waiting mode and back hides the frozen cursor. Seems, it's belongs to screen lock. Cursor just doesn't disappear entering system.
Comment 2 kostyarin 2021-07-16 17:46:36 UTC
Not sure it's about kwin. I just don't know enough to choose a correct category.
Comment 3 kostyarin 2021-08-05 11:54:54 UTC
Is anyone here?
Comment 4 kostyarin 2021-08-05 12:09:31 UTC
Very annoying. Makes KDE useless. Critical.
Comment 5 ventusliberum 2021-08-15 14:12:01 UTC
Same situation on my archlinux KDE Wayland machine. Though I have 'Lock screen automatically' disabled, I also get the second fixed cursor every time after waking my screen up from energy saving.
Comment 6 Zamundaaa 2021-08-30 20:55:20 UTC
KWin probably falls back to a software cursor and fails to un-set the hardware cursor. Can you attach ~/.local/share/sddm/wayland-session.log?
Comment 7 kostyarin 2021-08-31 00:33:47 UTC
Created attachment 141173 [details]
~/.local/share/sddm/wayland-session.log

Hello, Zamundaaa. Here you are.
Comment 8 Zamundaaa 2021-08-31 19:19:46 UTC
It seems like we're not printing the error messages without debug logging. Could you please enable it with the environment variable
QT_LOGGING_RULES="kwin_*.debug=true"
(just put that into /etc/environment) and upload the log after the bug happens again?
Comment 9 kostyarin 2021-09-01 07:24:17 UTC
Created attachment 141206 [details]
~/.local/share/sddm/wayland-session.log with debug logs

With debug logs in attachment

    $ env | grep QT
    QT_LOGGING_RULES=kwin_*.debug=true
    QT_QPA_PLATFORMTHEME=qt5ct
    PLASMA_USE_QT_SCALING=1
    QT_WAYLAND_FORCE_DPI=96
    QT_AUTO_SCREEN_SCALE_FACTOR=0
Comment 10 Eduardo 2021-09-11 23:24:36 UTC
I'm affected. I have a laptop with NVidia prime configuration, with both a touchpad and a connected USB mouse, if that's relevant. 

It happens every time when computer goes to sleep automatically due to inactivity timeout. After resuming, I always have an extra dead cursor permanently displayed.

"kwin_wayland --replace" is somewhat a workaround, faster than rebooting, but it still kills the running apps. Any better (less drastic) workaround while it is not fixed?
Comment 11 Zamundaaa 2021-09-16 19:03:35 UTC
> Any better (less drastic) workaround while it is not fixed?
You can try the environment variable "KWIN_FORCE_SW_CURSOR" to force KWin to never use the hardware cursor. Please report back if that works as I can't reproduce this bug on 5.22.5 or git master.
Comment 12 kostyarin 2021-09-18 01:24:34 UTC
> You can try the environment variable "KWIN_FORCE_SW_CURSOR" to force KWin to never use the hardware cursor. Please report back if that works 

With KWIN_FORCE_SW_CURSOR=1 two days works fine. I keep monitoring.

> I can't reproduce this bug on 5.22.5 or git master.

May be it affects NVidia cards only.
Comment 13 kostyarin 2021-09-18 15:55:21 UTC
> With KWIN_FORCE_SW_CURSOR=1 two days works fine. I keep monitoring.

Hm. No, it doesn't help. I've got one frozen cursor. Seems, auto screen lock with fullscreen video increases the chance of the bug.

    $ env | grep KWIN_FORCE_SW_CURSOR
    KWIN_FORCE_SW_CURSOR=1
Comment 14 Zamundaaa 2021-09-23 12:27:29 UTC
I think I found the cause of the issue (which can only be observed when using a software cursor, like we always do with NVidia), and I'm pretty sure it's already fixed in 5.23. Feel free to re-open if I'm mistaken
Comment 15 kostyarin 2021-11-04 17:00:11 UTC
5.23 works fine.