Bug 511653 - Cursor leaves artifacts when flicked below maximized application
Summary: Cursor leaves artifacts when flicked below maximized application
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: input (other bugs)
Version First Reported In: 6.5.1
Platform: Fedora RPMs Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-05 00:36 UTC by clarkbirdobserver
Modified: 2025-11-22 00:37 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.5.4
Sentry Crash Report:


Attachments
The aftermath of the aforementioned issue. My cursor is above the bottom of the screen, but an artifact resembling it is visible below it (271.84 KB, image/jpeg)
2025-11-05 00:42 UTC, clarkbirdobserver
Details

Note You need to log in before you can comment on or make changes to this bug.
Description clarkbirdobserver 2025-11-05 00:36:07 UTC
Note: Apologies if this is filed incorrectly, this is my first report.
SUMMARY
When "flicking" the mouse cursor down to the bottom of the screen and back up while another application is in full-screen, it leaves artifacts behind.
STEPS TO REPRODUCE
1. Put at application into full-screen, such as by pressing the full-screen button in the corner.
2. Flick your mouse cursor below the bottom edge of the screen and back up repeatedly.
OBSERVED RESULT
Visual artifacts are left behind when the cursor comes back up.
EXPECTED RESULT
No artifacts are present.
SOFTWARE /OS VERSIONS
Linux: Fedora Linux Asahi Remix 42
KDE Plasma Version: 6.5.1
KDE Frameworks Version: 6.19.0
Qt Version: 6.9.3

Additional Note: The issue does not appear while recording my screen, hence the low quality of the attachment.
Comment 1 clarkbirdobserver 2025-11-05 00:42:54 UTC
Created attachment 186502 [details]
The aftermath of the aforementioned issue. My cursor is above the bottom of the screen, but an artifact resembling it is visible below it
Comment 2 TraceyC 2025-11-06 23:28:39 UTC
Thanks for taking time to file your first bug report! No worries about the quality of your screenshot, it shows what you're describing. The symptoms look like bug 502117.

Based on that screenshot, and your description, it looks like the Firefox window is maximized, rather than fullscreen. I can still see the panel at the bottom. The buttons at the top of the window, from right to left, are close, maximize, and minimize. 
I'm not able to immediately reproduce this on Plasma 6.5.1 or built from git-master.

What graphics card do you have in the system? You can see it in kinfo or in About This System in the menu. Thanks!
Comment 3 clarkbirdobserver 2025-11-06 23:45:27 UTC
> The symptoms look like bug 502117.
They are actually different, the artifact isn’t always an entire cursor. Sometimes it’s just a part of it.
> Based on that screenshot, and your description, it looks like the Firefox
> window is maximized, rather than fullscreen.
Yes, my bad.
> What graphics card do you have in the system?
Apple M2. I’m using a 13-inch M2 from 2022.
Comment 4 TraceyC 2025-11-07 18:10:05 UTC
Thanks for the details. I'll let those more familiar with kwin and cursors take it from here.
Comment 5 Zamundaaa 2025-11-17 17:30:54 UTC
IIRC the Apple iGPU can't crop planes, so when the cursor is partially off-screen, KWin has to fall back to a software cursor. Maybe something goes wrong when hiding that software cursor again.

Please set https://invent.kde.org/plasma/kwin/-/wikis/Environment-Variables#kwin_force_sw_cursor and see if it still happens then.
Comment 6 clarkbirdobserver 2025-11-17 18:42:33 UTC
> Please set
> https://invent.kde.org/plasma/kwin/-/wikis/Environment-
> Variables#kwin_force_sw_cursor and see if it still happens then.

I’m not entirely sure how to do that. I added /home/[my name]/.config/plasma-workspace/env/kwin_vars.sh and wrote the following in it.
“#!/bin/sh

export KWIN_FORCE_SW_CURSOR=true”

After restarting, the issue still occurs. Please tell me if this is not the correct way to do it.
Comment 7 Zamundaaa 2025-11-17 20:21:14 UTC
Oh, sorry, I should've specified that you need to set it to "1", the location of the script is ok. Though I should also just make KWin accept "true" for boolean env vars...
Comment 8 clarkbirdobserver 2025-11-17 20:47:24 UTC
> Oh, sorry

No worries! I got it working, and the issue no longer happens. Looks like your hunch was right. I’d guess that the issue is that the software cursor isn’t properly cleared after switching back.
Comment 9 Bug Janitor Service 2025-11-17 21:35:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8448
Comment 10 Zamundaaa 2025-11-17 21:36:16 UTC
I managed to emulate the GPU restriction here and could reproduce the problem. The MR should fix it
Comment 11 Zamundaaa 2025-11-18 15:32:09 UTC
Git commit 24c3cd07faf3e8355a555cfdd3218f13a953c3b8 by Xaver Hugl.
Committed on 18/11/2025 at 14:53.
Pushed by zamundaaa into branch 'master'.

scene/scene: schedule pending repaints for child items too

Otherwise, the cursor surface or image item's pending repaints get ignored.

M  +10   -1    src/scene/scene.cpp

https://invent.kde.org/plasma/kwin/-/commit/24c3cd07faf3e8355a555cfdd3218f13a953c3b8
Comment 12 Zamundaaa 2025-11-18 16:37:37 UTC
Git commit c3dc3307a75121aa00928e4527980fdcdd49cace by Xaver Hugl.
Committed on 18/11/2025 at 15:36.
Pushed by zamundaaa into branch 'Plasma/6.5'.

scene/scene: schedule pending repaints for child items too

Otherwise, the cursor surface or image item's pending repaints get ignored.
(cherry picked from commit 24c3cd07faf3e8355a555cfdd3218f13a953c3b8)

M  +10   -1    src/scene/scene.cpp

https://invent.kde.org/plasma/kwin/-/commit/c3dc3307a75121aa00928e4527980fdcdd49cace