Bug 466749 - Glitching cursor and screen content in applications in full screen when using a fractional scaling factor
Summary: Glitching cursor and screen content in applications in full screen when using...
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 5.27.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-02 23:00 UTC by Hexagon
Modified: 2024-04-27 01:07 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hexagon 2023-03-02 23:00:42 UTC
SUMMARY
Visual glitches in Firefox

STEPS TO REPRODUCE
1. Using KDE Plasma (Wayland) set your monitor scaling factor to a fractional value like 150%, 195%, etc. 100% and 200% do not have this problem.
2. Open Firefox in Wayland mode with "MOZ_ENABLE_WAYLAND=1 firefox" and check if it is actually running in Wayland mode using "qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole" in the terminal.
3. Open a YouTube video in full screen an let it play.
4. Move the mouse cursor slowly. 

OBSERVED RESULT
When moving the mouse cursor depending on which scaling value is chosen exactly and the monitor resolution one or both glitches occur:
1) The mouse cursor flickers, jumps or changes in size (from it's 100% scale size to f.e. 150% and back and forth)
2) The whole window jitters left and right by a few pixels. Maybe this is related to https://bugs.kde.org/show_bug.cgi?id=459373 where full screen applications leave pixel gaps.

EXPECTED RESULT
When moving the mouse cursor it should stay consistently in size and the browser content should not wiggle.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.2.1-arch1-1 (64-bit)
KDE Plasma Version: 5.27.2
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Graphics Platform: Wayland
Comment 1 15c730840a66 2023-03-03 21:45:58 UTC
I'm having the same problem, but only for scaling factors below 150%. This might be because it's my secondary 1080p monitor and my primary 4K monitor is set to 200% scale.
The problem also happens in Chromium browsers, but not consistently, and only after the "press Esc to exit fullscreen" popup has disappeared.
Comment 2 Evan 2023-03-22 23:30:39 UTC
This is happening for me as well on 2 machines, one with 4k 150% scaling and the other 1080p 125% scaling
Comment 3 Hexagon 2023-05-16 09:56:45 UTC
I just discovered that this does not only happen on YouTube, but every website triggering the "full screen" function of Firefox which is not the same as pressing F11. When using F11 the problem is not there. The fullscreen function of the browser can be called by JavaScript and Firefox presents a banner on the top on enabling stating "my.site.com is now full screen. Exit Full Screen (ESC)".
It is probably this: docElm.mozRequestFullScreen();
https://hacks.mozilla.org/2012/01/using-the-fullscreen-api-in-web-browsers/
Comment 4 Hexagon 2023-06-14 20:31:45 UTC
I just discovered, that it does not only occur in Firefox but other applications too and seems to be a general problem of KWin, therefore I changed the ticket title. It also happens on Signal. To reproduce it there send a video into a chat and start playback of it, enter fullscreen playback and move the mouse. You see the same glitches and mouse cursor size changes as in Firefox playing a YouTube video.
Comment 5 Hexagon 2023-06-14 21:37:24 UTC
New info of a chat with a KWin developer:

The problem started after "Direct Scanout" was implemented in KDE Plasma 5.27 released on 2023-02-14.

Workaround: One can disable the "Direct Scanout" using the environment variable "KWIN_DRM_NO_DIRECT_SCANOUT=1" in /etc/environment and relogging / restarting the computer. The problem should go away.
Comment 6 Zamundaaa 2024-04-27 01:07:03 UTC
Afaik this has been fixed in amdgpu, with https://patchwork.freedesktop.org/patch/557059/