Bug 474488 - Panel flickering at the top of some fullscreen games
Summary: Panel flickering at the top of some fullscreen games
Status: REOPENED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.7
Platform: Fedora RPMs Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 480402 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-09-13 13:36 UTC by heroshiheroart
Modified: 2024-04-06 16:54 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description heroshiheroart 2023-09-13 13:36:24 UTC
SUMMARY
That's a old bug that I've never found a report about. Basically when using some specific applications, firstly games, on fullscreen, when you do some action like open a menu or you're transacting from an area to other, the panels start to flicker/flashing above the game window. 

STEPS TO REPRODUCE
1. Open the game/application at fullscreen, I've tested this at Tales of Beseria (Wine/Proton).
2. Do some actions like open a menu, load your save, go to other area at the game (At Tales of Beseria)
3. The bar starts to flicker above the game window

OBSERVED RESULT
The bar starts to flicker above the window as you can see at this video of other game:
https://old.reddit.com/r/kde/comments/pz19hr/how_to_fix_taskbar_flicker_in_games_i_have/

EXPECTED RESULT
The panel behave like at other desktop environments and don't flicker at the fullscreen window.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Linux
(available in About System)
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
That problem can also happen with native linux  games/applications.
When Kwin compositor is enabled at X11 or at Wayland, we have a variation of this bug where the fullscreen window shrink horizontally.
The only way to prevent this bug is setting the panel to auto-hide, or allowing the windows to appear above the panel.
Comment 1 Nate Graham 2023-09-13 17:32:58 UTC
> KDE Plasma Version: 5.24.7

That's a fairly old Plasma version at this point. Can you upgrade to a newer Fedora release so you can try again with 5.27? Thanks!
Comment 2 heroshiheroart 2023-09-13 19:11:57 UTC
(In reply to Nate Graham from comment #1)
> > KDE Plasma Version: 5.24.7
> 
> That's a fairly old Plasma version at this point. Can you upgrade to a newer
> Fedora release so you can try again with 5.27? Thanks!

Good afternoon, I updated the desktop and everything is running at the following versions:
Linux/KDE Plasma: Fedora Linux 38
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10

And this bug still happening. I indexed a video from other person that had this same issue have almost 2 years, but I also recorded the reproduction of this bug happening with me, where I can upload it to help?
Comment 3 heroshiheroart 2023-09-13 19:21:48 UTC
I uploaded the videos at Google Drive:
https://drive.google.com/drive/folders/1mE5_kk4XpU128wRML3m4UZt0b7QOhdbT?usp=sharing

The videos 1 and 2, I did at X11, and the 3 and 4 at Wayland, but if you uncheck the option to disable the compositor at fullscreen windows on X11, will have the exactly same effect.
Comment 4 Nate Graham 2023-09-14 18:30:05 UTC
Thank you very much for following up!
Comment 5 Zamundaaa 2023-09-19 14:27:23 UTC
> That problem can also happen with native linux  games/applications

Can you give some more examples, ideally with some free application? I haven't ever seen this issue, being able to make it happen locally would go a long way in making it easier to fix it.

As a shot in the dark, does this still happen if you disable the "Full Screen" desktop effect in the settings?
Comment 6 heroshiheroart 2023-09-19 16:20:10 UTC
(In reply to Zamundaaa from comment #5)
> > That problem can also happen with native linux  games/applications
> 
> Can you give some more examples, ideally with some free application? I
> haven't ever seen this issue, being able to make it happen locally would go
> a long way in making it easier to fix it.
> 
> As a shot in the dark, does this still happen if you disable the "Full
> Screen" desktop effect in the settings?

I never (In reply to Zamundaaa from comment #5)
> > That problem can also happen with native linux  games/applications
> 
> Can you give some more examples, ideally with some free application? I
> haven't ever seen this issue, being able to make it happen locally would go
> a long way in making it easier to fix it.
> 
> As a shot in the dark, does this still happen if you disable the "Full
> Screen" desktop effect in the settings?

Correction: This problem probably can also affect some Linux native games/applications*. I don't have any knowledge about other games/applications that have this issue, it mainly happened to me with games running at Proton (Wine), I can test other applications that I use to see if that behavior happens.

An user said at a post that I've linked:
"This sounds like KDE should fix this by adding detection if something is using full screen and not to try to overlap.

The flickering happens when taskbar and game disagree on which should be the topmost display. When a game is fullscreen it should be the one on top, but for some reason compositor/taskbar does not know to "back off".

KDE already knows when application is fullscreen (titlebar is not rendered, for example) so it should have the necessary information to handle fullscreen in the taskbar as well.

This is a bug on KDE taskbar handling".
Comment 7 Zamundaaa 2023-09-19 16:43:24 UTC
> it mainly happened to me with games running at Proton (Wine), I can test other applications that I use to see if that behavior happens

Wine or not doesn't really matter to me, it just needs to be some game or application that's either free or that someone in the development team already has.

> An user said at a post that I've linked...

Yes, but looking at your videos 3 and 4, their assessment doesn't seem to be correct. The game window is changing in height and so you see part of the screen on the bottom and on the top.

If I understand correctly, videos 1 and 2 are with the X11 compositor disabled, right?
Comment 8 heroshiheroart 2023-09-19 17:01:29 UTC
(In reply to Zamundaaa from comment #7)
> > it mainly happened to me with games running at Proton (Wine), I can test other applications that I use to see if that behavior happens
> 
> Wine or not doesn't really matter to me, it just needs to be some game or
> application that's either free or that someone in the development team
> already has.
> 
> > An user said at a post that I've linked...
> 
> Yes, but looking at your videos 3 and 4, their assessment doesn't seem to be
> correct. The game window is changing in height and so you see part of the
> screen on the bottom and on the top.
> 
> If I understand correctly, videos 1 and 2 are with the X11 compositor
> disabled, right?

Yes, 1 and 2 are with X11 with the compositor disabled and 3 and 4 at Wayland with compositor on (because Wayland doesn't allow the possibility of disabling it), but the same thing happens when using x11 with compositor on. The games that I know that this bugNhappen are:

- Crosscode
- Tales of Beseria (Probably Tales of Zestiria too)
- Shin Megami Tensei 3
- Neon Abyss
Comment 9 heroshiheroart 2023-09-19 17:10:45 UTC
(In reply to Zamundaaa from comment #7)

> Wine or not doesn't really matter to me, it just needs to be some game or
> application that's either free or that someone in the development team
> already has.

Crosscode have a demo avaliable at itch.io, Download the Windows version and run it at Lutris or Bottles
https://radicalfishgames.itch.io/crosscode
Comment 10 heroshiheroart 2023-09-19 17:13:33 UTC
(In reply to heroshiheroart from comment #9)

> Crosscode have a demo avaliable at itch.io, Download the Windows version and
> run it at Lutris or Bottles
> https://radicalfishgames.itch.io/crosscode

Neon Abyss also have a demo avaliable at Steam:
https://store.steampowered.com/app/788100/Neon_Abyss/
Comment 11 Zamundaaa 2023-09-22 13:51:55 UTC
Hmm, I tried Neon Abyss and it doesn't happen for me. Can you give me more details about your setup, like the specific resolution, scaling, game settings etc?
Comment 12 heroshiheroart 2023-09-22 17:03:01 UTC
(In reply to Zamundaaa from comment #11)
> Hmm, I tried Neon Abyss and it doesn't happen for me. Can you give me more
> details about your setup, like the specific resolution, scaling, game
> settings etc?

Everything is default, I'm running with a i5-7400 with an NVIDIA 1050ti, my monitor have 75hz, no extra monitors, normal scaling, 1080p. At Neon Abyss it happens with me at the loading screen. If you changed something related to the Plasma Panel I recommend to test it after reboot. If you can also test Crosscode at Wine, because is the game where this issue seems to be more clear to happen.
Comment 13 Zamundaaa 2023-09-26 16:07:45 UTC
On my 1080p laptop I do see the issue in Neon Abyss when going back to the menu
Comment 14 Zamundaaa 2023-09-27 20:07:24 UTC
Checking the resize events, it looks like the game is resizing the window itself - even multiple times between maximized and fullscreen sizes. I don't think there's anything we can do about that.

This only really becomes visible because of the fullscreen effect though, which animates the changes. That can probably be fixed
Comment 15 heroshiheroart 2023-09-29 14:32:14 UTC
(In reply to Zamundaaa from comment #14)
> Checking the resize events, it looks like the game is resizing the window
> itself - even multiple times between maximized and fullscreen sizes. I don't
> think there's anything we can do about that.
> 
> This only really becomes visible because of the fullscreen effect though,
> which animates the changes. That can probably be fixed

Probably some game engines do that (resize the windows) when loading other "stage" (Menus, Loading Screens, Inventory), but at Windows and at other Linux DE's like GNOME or Cinnamon, the transition don't have this issue because it doesn't animate the changes, as you said.
Comment 16 heroshiheroart 2023-11-16 21:50:22 UTC
Came here to say that I got an AMD graphic card and this issue also happens with it at the same way, so is not a GPU related issue. I also tested the latest KDE Neon Testing (from 14/11/2023) and KDE Plasma 6 still have this same problem.
Comment 17 Bug Janitor Service 2024-01-17 10:23:36 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4957
Comment 18 Zamundaaa 2024-01-17 11:02:52 UTC
Git commit e9db9cd7d3a4bc6b1845b5004cd3a1bd165a5ff9 by Xaver Hugl.
Committed on 17/01/2024 at 11:18.
Pushed by zamundaaa into branch 'master'.

plugins/fullscreen: retarget the animation instead of restarting it
FIXED-IN: 6.0

M  +47   -27   src/plugins/fullscreen/package/contents/code/main.js

https://invent.kde.org/plasma/kwin/-/commit/e9db9cd7d3a4bc6b1845b5004cd3a1bd165a5ff9
Comment 19 Zamundaaa 2024-01-17 11:18:00 UTC
Git commit 6e8f56f713b1334ed39cc594068c68267ebe211f by Xaver Hugl.
Committed on 17/01/2024 at 12:03.
Pushed by zamundaaa into branch 'Plasma/6.0'.

plugins/fullscreen: retarget the animation instead of restarting it
FIXED-IN: 6.0


(cherry picked from commit e9db9cd7d3a4bc6b1845b5004cd3a1bd165a5ff9)

M  +47   -27   src/plugins/fullscreen/package/contents/code/main.js

https://invent.kde.org/plasma/kwin/-/commit/6e8f56f713b1334ed39cc594068c68267ebe211f
Comment 20 Zamundaaa 2024-01-28 21:15:26 UTC
*** Bug 480402 has been marked as a duplicate of this bug. ***
Comment 21 heroshiheroart 2024-01-30 21:45:43 UTC
Hello, I've tested the Plasma 6 to see if this issue was solved. The screen twitching horizontally was fixed, but the bar still flickering above the game window, as if Plasma cannot "isolate" the fullscreen/borderless fullscreen window as the other desktop environments can, and these resizing events become visible when playing the game/using the software. 

Tested at:
Linux/KDE Plasma: KDE Neon Unstable
KDE Plasma Version: 6.0.80
KDE Frameworks Version: 5.249.0
Qt Version: 6.6.1

Happens both on Wayland and X11, but on Wayland is a little less noticeable.
Comment 22 Zamundaaa 2024-01-31 12:39:19 UTC
Can you provide a screen recording of what exactly it does? I don't see anything even with the slowest animation speed.

> as if Plasma cannot "isolate" the fullscreen/borderless fullscreen window as the other desktop environments can

The problem is that the window is not actually fullscreen. It switches back and forth between maximized and fullscreen... It's likely that this can never be fixed entirely, aside from changing apps not to do this anymore.
Comment 23 Alexey 2024-02-11 10:36:56 UTC
(In reply to Zamundaaa from comment #22)
> The problem is that the window is not actually fullscreen.
The problem is not reproducible in other desktop environments, so even if the change didn't fix the problem, it's still a problem on the KWin side.
Comment 24 Alexey 2024-04-06 16:54:23 UTC
(In reply to Alexey from comment #23)
> (In reply to Zamundaaa from comment #22)
> > The problem is that the window is not actually fullscreen.
> The problem is not reproducible in other desktop environments, so even if
> the change didn't fix the problem, it's still a problem on the KWin side.

Today I was able to reproduce the bug with Diablo II under Wine. Yes, this bug report should be reopened.