Frequently toggling fullscreen causing window flickering

Hi~

I am using a laptop with a 120Hz refresh rate display and installed with Manjaro KDE Plasma 6.2.5 Wayland.
I found that when using Firefox, if I continuously press F11 and frequently switch between full-screen modes, occasionally the underlying window is revealed, causing flickering.
I tested Firefox under Windows 11 and found that this issue does not occur.
I think this is something related to Kwin.
This issue is not really a common usecase. But if it could be fixed, It will be better :slight_smile: .

Reproduce procedure:

For firefox:

  1. Open Firefox
  2. Toggle fullscreen mode frequently (For firefox it’s long-press F11)

For other app (like mpv or konsole):

  1. Bind fullscreen shortcut key to whatever U like.
  2. Rapidly tap the full screen key (long-pressing seems works too).

What you will see:

Warning: Flickering Warning: Patients with photosensitive epilepsy should not play the gif in details.

anim

Expected behavior:

Getting window always showup and follow right z-index

anim1
It’s hard to compress the gif to fit into the forum upload size restriction. And ends up to causing the FPS is too low to show up clearly. But there is no flickering in Win11 24H2.

Can U guys reproduce this?

Hi - I think this could occur with any application, not just Firefox, if you’re following the approach of rapidly pressing that application’s full-screen toggle command to switch it back and forth (I could also see that with a Chromium-based browser, and with Okular).

Can I ask what the use case is that is leading to you inputting rapid full-screen toggles like that? There might be an easier way to accomplish what you’re after :slight_smile:

1 Like

Thank you for your reply. :wink:
Indeed, other applications may have this problem too. Regarding the use case, there isn’t any particular scenario that demands rapid switching fullscreen. So not a big deal anyway. Just Kwin would be better without the flickering. :face_with_peeking_eye:
I just happened to notice it while playing around, and it seemed a bit odd to have this flickering. I thought Kwin did not behave like this before.
So I thought I’d bring it up for everyone to discuss. :wink:

Ah - fair enough :slight_smile: I can’t speak to whether or not that’s new (never tried it before!), but conceptually it would make sense to try to avoid that split-second of exposing the window underneath the current one, if possible.

It might make sense, then, to file a bug report just to ensure that the issue is documented, and that folks looking to make changes to KWin code can identify and track it. If you haven’t used the KDE Bugtracking System before, the Community Wiki guide to reporting issues is located here: Get Involved/Issue Reporting - KDE Community Wiki

1 Like

https://bugs.kde.org/show_bug.cgi?id=499533
Bugzilla filled.

This is an upstream AMD graphics driver issue; possibly Desktop flickering Radeon 7900xtx at 4k 144hz (#3602) · Issues · drm / amd · GitLab or a similar one. I experience it myself on a laptop with a AMD Radeon 780M GPU and a 120hz screen.

1 Like

WOW! :astonished:
Indeed it is like this. Because I mainly use the Ryzen 3700x Vega56 and 7840HS, which are all AMD platforms, then I didn’t realize that the AMDGPU driver has such a problem.
I just tried it with my old laptop from 10 years ago (Intel Core I3-2370M) with Plasma, and there is no such issue.
It’s indeed not a problem with Kwin, but with AMD.
I have to say, there are really many small problems with the 7840HS Phoenix platform, and it seems like many recent issues on drm/amd are related to Phoenix.
I have a similar spec with you. a 780M with a 120Hz 2880x1800 display. It flickers on Linux, and it also flickers on Windows, LOL. :joy:
Thanks, Ngraham! :+1:

1 Like

Yup, same GPU, same refresh rate, same resolution as me. This specific panel is quite common in laptops from the past year or two, but unfortunately seems to be rather buggy with AMD graphics. The Mesa issue tracker is littered with reports about it.

For example:

Personally I’ve managed to mostly fix all the issues by setting the amdgpu.dcdebugmask=0x10 kernel option. With this, almost all the issues are gone except for some random flickering once or twice a day that goes away if I wiggle the cursor enough.

1 Like

Same kernel option as you. :+1:
I’m using kernel 6.14 RC1 and 6.13.These version have no jerkiness.
Kernel 6.12 is buggy now. I also have issues just like you post. Maybe AMD will backport someday because of LTS. :joy:

That doesn’t really look related.

This looks more like a bug with the fullscreen effect to me. I don’t know why it wouldn’t happen on Intel, but the effect works with painting a semi-transparent version of the window, which is a known flaw with cross fade effects in general. IIRC it has caused other minor issues before.

Triggering this (for obvious reasons) normally completely untested scenario on my desktop PC also shows it.

1 Like

You’re correct.
I turn off fullscreen effect, then the issue is gone.
So, the fullscreen effect is indeed causing this issue.
anim1