Bug 510195 - Some XWayland-using apps flicker on external display
Summary: Some XWayland-using apps flicker on external display
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (other bugs)
Version First Reported In: 6.4.91
Platform: Kubuntu Linux
: HI normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen, regression
Depends on:
Blocks:
 
Reported: 2025-10-03 11:04 UTC by Cristiano Rodrigues
Modified: 2025-10-07 13:58 UTC (History)
1 user (show)

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


Attachments
Video made with my phone (43 bytes, text/plain)
2025-10-03 11:25 UTC, Cristiano Rodrigues
Details
Link to video made with spectacle screen recorder (43 bytes, text/plain)
2025-10-03 11:31 UTC, Cristiano Rodrigues
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cristiano Rodrigues 2025-10-03 11:04:41 UTC
SUMMARY
With a dual monitor setup, some applications on the external display will make it flicker very hard.
It flickers with google chrome (in wayland mode), it flickers with eclipse (in xwayland mode and not in wayland mode).
With these two applications it is certain the display wilil flicker. It also flickers with KDE apps (okular, kmail, kate, etc), but with these apps it seems random, the screen starts to flicker without any input from my side

STEPS TO REPRODUCE
1. Set up a laptop with an external display 
2. open eclipse (GDK_BACKEND=x11 flag set) in the external display, and maximize the window
3. move the mouse around our right click on the mouse to access any pop up menu

OBSERVED RESULT
The screen start to flicker 

EXPECTED RESULT
Steady image

SOFTWARE/OS VERSIONS
Operating System: Ubuntu 13
KDE Plasma Version: 6.4.91
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2
Kernel Version: 6.17.0-061700-generic (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 9 6900HX with Radeon Graphics
Memory: 40 GiB of RAM (34,9 GiB usable)
Graphics Processor 1: AMD Radeon 680M
Graphics Processor 2: AMD Radeon RX 6800S
Manufacturer: LENOVO
Product Name: 82UG
System Version: Legion S7 16ARHA7

I made a video with the spectacle screen recorder and it did no catch any flickering. But, at same time, I also made a video with my phone and  the flicker is very visible.
Comment 1 Cristiano Rodrigues 2025-10-03 11:14:21 UTC
It started with the first beta (6.5.90), but I waited for the beta 2 release to see if it was something that was missing out.
Comment 2 Cristiano Rodrigues 2025-10-03 11:25:14 UTC
Created attachment 185478 [details]
Video made with my phone

This video was make with my phone since the video that was made with spetacle (at the same time) got no flickering
Comment 3 Cristiano Rodrigues 2025-10-03 11:31:47 UTC
Created attachment 185479 [details]
Link to video made with spectacle screen recorder

Link to video made with spectacle screen recorder
Comment 4 Bug Janitor Service 2025-10-06 20:12:22 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8198
Comment 5 Cristiano Rodrigues 2025-10-07 04:04:18 UTC
(In reply to Bug Janitor Service from comment #4)
> A possibly relevant merge request was started @
> https://invent.kde.org/plasma/kwin/-/merge_requests/8198

Hello!

I applied the "backends/drm: clear the import damage journal after renderTestBuffer" commit on http://download.kde.org/unstable/plasma/6.4.91/kwin-6.4.91.tar.xz source package, compiled it, replaced the "kwin_wayland_wrapper" and "kwin_wayland" files by the new ones. The external display no longer flickers while running Eclipse or Kicad.
Comment 6 Zamundaaa 2025-10-07 11:12:43 UTC
Git commit b952e59442f96ca89ff64ecaf4ad56f1d8c19ded by Xaver Hugl.
Committed on 07/10/2025 at 10:47.
Pushed by zamundaaa into branch 'master'.

backends/drm: clear the import damage journal after renderTestBuffer

Otherwise, the newly allocated buffer has an entry in the damage journal, which
means it only gets partially repainted when drawing an actual frame. The result
of that was heavy flickering, until that buffer got fully repainted.

M  +2    -0    src/backends/drm/drm_egl_layer_surface.cpp

https://invent.kde.org/plasma/kwin/-/commit/b952e59442f96ca89ff64ecaf4ad56f1d8c19ded
Comment 7 Zamundaaa 2025-10-07 13:58:11 UTC
Git commit 5a8f9117ae7d9b11f32b9c88ca3c8111b1a0d7c0 by Xaver Hugl.
Committed on 07/10/2025 at 12:19.
Pushed by zamundaaa into branch 'Plasma/6.5'.

backends/drm: clear the import damage journal after renderTestBuffer

Otherwise, the newly allocated buffer has an entry in the damage journal, which
means it only gets partially repainted when drawing an actual frame. The result
of that was heavy flickering, until that buffer got fully repainted.


(cherry picked from commit b952e59442f96ca89ff64ecaf4ad56f1d8c19ded)

Co-authored-by: Xaver Hugl <xaver.hugl@kde.org>

M  +2    -0    src/backends/drm/drm_egl_layer_surface.cpp

https://invent.kde.org/plasma/kwin/-/commit/5a8f9117ae7d9b11f32b9c88ca3c8111b1a0d7c0