Bug 455675 - Firefox (and other apps) strobe on resize - failed repaint?
Summary: Firefox (and other apps) strobe on resize - failed repaint?
Status: RESOLVED DUPLICATE of bug 455617
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 5.25.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
Depends on:
Reported: 2022-06-20 20:16 UTC by zacharytalis
Modified: 2022-06-21 11:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:

STROBE WARNING - Firefox flicker (171.07 KB, video/mp4)
2022-06-20 20:18 UTC, zacharytalis

Note You need to log in before you can comment on or make changes to this bug.
Description zacharytalis 2022-06-20 20:16:19 UTC
Certain resize actions trigger strobing/flickering where the window "used to be". Per reports, this bug affects Firefox, Thunderbird, and Qalculate.
KDE 5.25 introduced this issue. Issue occurs in X11 across both AMD and NVIDIA (proprietary) graphics.
The only known workaround is to suspend compositing (default Alt+Shift+F12), which mitigates the issue entirely.
I'm marking this as a major bug, since the strobing is severe and the workaround isn't great.
Other reported instances of this bug (both Arch and KDE Neon):

1. Launch Firefox, Thunderbird, or Qalculate.
2. Resize/edge snap/fullscreen the app window.
3. Observe strobing where app hasn't been repainted.

Flicker, per attached video.

No flicker.

For my machine ~
Operating System: Arch Linux
KDE Plasma Version: 5.25.0
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.5
Kernel Version: 5.18.5-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-7700K CPU @ 4.20GHz
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1080 Ti/PCIe/SSE2

Attempted mitigation steps, none of which work:
- Disable hardware acceleration in Firefox
- Disable all Kwin scripts
- Disable desktop effects
- Power off all monitors besides primary
- Adjust system animation speed
Comment 1 zacharytalis 2022-06-20 20:18:15 UTC
Created attachment 149965 [details]
STROBE WARNING - Firefox flicker
Comment 2 Vlad Zahorodnii 2022-06-21 06:47:10 UTC
It looks related to the opaque region hint.
Comment 3 Vlad Zahorodnii 2022-06-21 06:58:56 UTC
Alright, this is a Firefox bug after all. Firefox creates two surfaces - one with the drop shadow, and the other with web page contents. It sets opaque regions on both surfaces, it's worth noting that the drop shadow surface has a hollow/transparent part where web page should be. It appears like when resizing firefox, the web page surface can uncover those hollow parts. Since firefox says that the hollow part is opaque, kwin won't try to repaint the area below it and you will see artifacts as in the video.

Why did it show up in 5.25? We made kwin use opaque region hints more "aggressively" in order to avoid repainting screen areas that are covered by opaque regions. So if you scroll a web page in firefox and firefox is the top most window, kwin should try to repaint firefox and nothing more.

That being said, this is a firefox bug. It should either ensure that web page surface always covers that hollow area (it would be the best solution as it is going to make window resizing more pleasant) or not set an opaque region in the drop shadow surface. I will file a bug report in bugzilla.mozilla.org if it's not already and link it here.
Comment 4 Vlad Zahorodnii 2022-06-21 07:01:39 UTC
Oh, nvm, I'm on wayland and you're on X11. This should be fixed in 5.25.1

*** This bug has been marked as a duplicate of bug 455617 ***
Comment 5 zacharytalis 2022-06-21 11:27:47 UTC
(In reply to Vlad Zahorodnii from comment #4)
> Oh, nvm, I'm on wayland and you're on X11. This should be fixed in 5.25.1
> *** This bug has been marked as a duplicate of bug 455617 ***

Thank youuuu <3