Bug 504900 - With highlight windows turned on, there's sometimes extremely rapid flickering when hovering over window preview of task manager windows
Summary: With highlight windows turned on, there's sometimes extremely rapid flickerin...
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager widgets (other bugs)
Version First Reported In: 6.3.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: accessibility
Depends on:
Blocks:
 
Reported: 2025-05-28 05:58 UTC by Adam Fontenot
Modified: 2025-06-26 11:24 UTC (History)
7 users (show)

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


Attachments
screencast of issue (60fps flicker - possible epilepsy trigger) (2.73 MB, video/webm)
2025-05-29 14:56 UTC, Adam Fontenot
Details
screencast of the issue (alt-tab + non-flickering version) (2.86 MB, video/webm)
2025-06-24 13:03 UTC, Adam Fontenot
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Fontenot 2025-05-28 05:58:01 UTC
SUMMARY

Unfortunately this doesn't happen reliably, but sometimes when I hover over the small window preview of the Icons Only Task Manager, the large preview flickers *extremely* rapidly, seemingly drawing and hiding the window on every other frame at 60 fps.

STEPS TO REPRODUCE
1. Open multiple windows in an application with window grouping enabled in the Icons Only Task Manager.
2. Hover over the icon to show the thumbnail preview for the windows.
3. Move your cursor to one of the preview thumbnails, which causes a full size preview of the window to be displayed. Move it to the other window(s), then back again. It sometimes takes a few attempts to reproduce the bug, and frequently I can't reproduce it at all.

OBSERVED RESULT

Extremely rapid flickering of the preview window.

See the screencast. 

EXPECTED RESULT

No flickering (window appears normally).

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.14.7-arch2-1 (64-bit)
Graphics Platform: Wayland
Graphics Processor: AMD Radeon Graphics (integrated)

ADDITIONAL INFORMATION

I'm using focus follows mouse. This is extremely speculative on my part, but I wonder if showing the preview under certain circumstances tricks Plasma / KWin into thinking that focus has been lost on the preview thumbnail, which causes it to hide the full size preview, which returns focus to the thumbnail - causing an endless cycle. I have no concrete reason for thinking this is the case, I just know this setting sometimes causes weird issues because the full time KDE devs don't really use it.
Comment 1 TraceyC 2025-05-28 21:55:25 UTC
I was unable to reproduce this on a system with Plasma built from git-master, an integrated AMD GPU and " focus follows mouse" - Qt 6.8. To be fair, you did say this was only reproducible sometimes. 

I also tested with Neon Testing, which has Qt 6.9.0
I'll leave this open for further investigation
Comment 2 David Edmundson 2025-05-29 11:08:40 UTC
>See the screencast.  
I think something went missing.

There's not much we can act on here in the present form. If you can find some more concrete steps please roepen.

There will be a change for 6.5 that uses the newer version of that window, so hopefully that will help.
Comment 3 Adam Fontenot 2025-05-29 14:56:23 UTC
Created attachment 181875 [details]
screencast of issue (60fps flicker - possible epilepsy trigger)

Sorry, I had originally recorded a screencast and intended to include it, but the video was worthless because the flickering was so rapid that Spectacle couldn't capture it. I'm adding a video I took with my phone. Is this enough information to re-open the issue? It's a real problem with KWin that I face every day. It may be hard to reproduce (though I'm happy to help) but I have no doubt others are affected.

Something else I've noticed from paying more attention to this recently is that the flicker seems to be visible in the thumbnail as well sometimes.
Comment 4 cwo 2025-05-29 15:20:17 UTC
I was able to reproduce it once, in a couple of minutes of trying (until all the flickering from the regular effect started giving me a headache...). Haven't managed to do it again, much less find reproduction steps that work.
Comment 5 TraceyC 2025-05-29 15:46:50 UTC
Marking confirmed, since cwo was able to reproduce
Comment 6 Adam Fontenot 2025-06-23 18:16:26 UTC
Repro'd with 6.4. Could also reproduce without focus follows mouse, so that's not the cause.

It's interesting that the flickering for me is always between the desktop wallpaper and the hovered window. I wonder if the way KWin implements the effect is by doing the "hide all windows" action when the cursor leaves a thumbnail, and then immediately showing the window for the newly hovered thumbnail. That seems to be the best explanation I can think of for the weird effect here. Sometimes the strobe even gets "stuck" on the desktop and I see the wallpaper for 4-5 seconds while hovering over a window thumbnail preview.

I've also noticed that the faster you move between the two window previews, the more common the issue seems to be. The longer it takes to draw a window, the more likely it is to see an issue with that window. (All based on very subjective judgments of course.) The flicker loop might be KWin getting confused about whether the desktop or the active window is on top, and switching between them, since the cursor is active over the thumbnail. That's just a guess on my part though.

Side note: but I find even the minimal "intended" flickering caused by the margin between the window thumbnails pretty irritating. I wonder if that gap might be closed and whether doing so could end up fixing this issue indirectly.
Comment 7 Adam Fontenot 2025-06-24 12:57:35 UTC
Additional suggestion for others who'd like to reproduce this: 

1. Maximize three windows of the same application on the same virtual desktop, with no other windows open on that desktop.
2. Alternate between hovering the thumbnail previews for the windows in the icons-only task manager with your cursor.

If you ever see a brief flash of your desktop wallpaper or an inactive window which is not one of the two you switched between, you're seeing some version of this issue, because the effect has been tricked into briefly showing the wrong thing before painting the right thing over it. I see both of these very frequently, even when flickering doesn't result. I think this is probably easier to reproduce.

Actually, I'm even able to reproduce this part of the issue with *other* ways of switching between window previews, including hovering the preview cards for separate windows in the "Icons and Text" task manager and even alt-tabbing between windows! I see a brief flash of either the desktop or an unrelated window after the setup instructions above. I've never gotten strobing with one of these methods though, so it never occurred to me to report it. Can others confirm? This is probably downstream of a more general KWin bug.

I'm not sure what causes the effect to sometimes strobe between the right and wrong previews, but figuring out why it *ever* shows the wrong thing and fixing that would probably resolve the issue.
Comment 8 Adam Fontenot 2025-06-24 13:03:56 UTC
Created attachment 182600 [details]
screencast of the issue (alt-tab + non-flickering version)

I managed to record the alt-tab issue with Spectacle (see attachment). Reproducing this is the same as above: just open three maximized windows on a virtual desktop and toggle between them with alt-tab. Hold alt once you press alt-tab and tab back and forth between two windows with tab and shift-tab.

Assuming this is a KWin bug, I'd be immensely grateful to anyone who could reproduce it and suggest how to report it. Should I move this bug to KWin or treat this (flickering in the task manager preview) as a separate issue and open one for KWin specific to the flash of content during the preview?
Comment 9 cwo 2025-06-24 13:33:26 UTC
Showing the desktop briefly while moving between two windows in a group is a known issue - when the mouse is travelling between the two, there's a zone where the effect is cancelled (as the mouse isn't over any thumbnail).

Showing the wrong window (or more precisely, turning the effect off despite hovering over something) is also a known issue when moving quickly - in some situations, the handler for the pointer leaving the first thumbnail is handled after the handler for starting the effect on the newly hovered window, so is immediately cancelled. (This is particularly easy to trigger if previews are disabled)

I had a workaround/fix for these a while ago, but couldn't find someone to do a code review. I haven't tried the patch in a few months, but it seems to still apply cleanly and probably still works: https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2816.

These issues shouldn't cause a flicker while hovering over a thumbnail, and shouldn't apply to the alt-tab switcher, so these are new (or another existing bug in the task switcher case, I haven't checked) . And from a quick testing it seems I can't reproduce the alt-tab one (but I usually have the effect firmly disabled on both).
Comment 10 Adam Fontenot 2025-06-24 14:00:18 UTC
(In reply to cwo from comment #9)
> Showing the desktop briefly while moving between two windows in a group is a
> known issue - when the mouse is travelling between the two, there's a zone
> where the effect is cancelled (as the mouse isn't over any thumbnail).

Thank you for providing feedback!

I think this is wrong? The dead zone between the two preview widgets reverts to showing the active window for me, not the desktop. The very brief flash of the desktop seems unexpected. "Canceling the effect" in between the widgets is expected (if irritating) - if you view the video, I think you'll see what I mean in that the desktop is shown despite a window being active.

> Showing the wrong window (or more precisely, turning the effect off despite
> hovering over something) is also a known issue when moving quickly - in some
> situations, the handler for the pointer leaving the first thumbnail is
> handled after the handler for starting the effect on the newly hovered
> window, so is immediately cancelled. (This is particularly easy to trigger
> if previews are disabled)

I think maybe I'm misunderstanding this part. When I said it shows the wrong window, I mean that it shows the *third* window described in the reproduction steps. That doesn't make sense to me because the handler for the cursor leaving the thumbnail shouldn't trigger this window being shown, since it's not the active window *or* one of the two windows being toggled between in this case.

This isn't shown in the video - when I captured it I was only seeing the issue where the desktop is flashed briefly.

> I had a workaround/fix for these a while ago, but couldn't find someone to
> do a code review. I haven't tried the patch in a few months, but it seems to
> still apply cleanly and probably still works:
> https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2816.

I think I'm going to try your patch just to see if it fixes any of my issues, if it will still compile against the 6.4 branch.
Comment 11 cwo 2025-06-24 14:16:19 UTC
Yeah, if all the windows are maximized then showing the background should be a separate issue.

If I look very closely, I can also see an unrelated window pop up for about a frame on the task switcher (most notable if there's a clear color difference between that window and the two others. Not sure what that is about, I suspect a kwin thing.
Comment 12 Adam Fontenot 2025-06-24 14:34:53 UTC
(In reply to cwo from comment #11)
> Yeah, if all the windows are maximized then showing the background should be
> a separate issue.
> 
> If I look very closely, I can also see an unrelated window pop up for about
> a frame on the task switcher (most notable if there's a clear color
> difference between that window and the two others. Not sure what that is
> about, I suspect a kwin thing.

Yep, that's what I'm thinking. And I think it's related to this issue, because generally the flicker I see is between whatever window I'm hovering over and the background. You can see this in the original 60fps flicker video attachment. Moreover, I rebuilt the Arch Linux plasma-desktop package (6.4.0) after applying your patch and rebooted, and I still see this issue where the desktop is shown when moving the cursor between the window previews in the task manager.

When you say that you can see an unrelated window pop up, that's on your own system? It's reassuring that you're able to reproduce that. Do you think all these issues are ultimately in how KWin is compositing the windows for the previews? I think an issue should probably be reported in wherever the source of the problem is, but it's not totally clear to me if that's KWin or if there are really separate issues with the task manager, alt-tab switcher, etc etc. If you have any advice that would be terrific!

Also curious if you're able to reproduce the issue with the desktop when toggling between active previews for *maximized* windows in the task manager.
Comment 13 cwo 2025-06-24 14:47:56 UTC
(In reply to Adam Fontenot from comment #12)
> Moreover, I rebuilt the Arch Linux plasma-desktop package
> (6.4.0) after applying your patch and rebooted, and I still see this issue
> where the desktop is shown when moving the cursor between the window
> previews in the task manager.

Yeah, that's what I thought.

> When you say that you can see an unrelated window pop up, that's on your own
> system? It's reassuring that you're able to reproduce that.

Yes.

> Do you think all
> these issues are ultimately in how KWin is compositing the windows for the
> previews?

I have no idea.

> Also curious if you're able to reproduce the issue with the desktop when
> toggling between active previews for *maximized* windows in the task manager.

I haven't seen that, only the unrelated window, but I might not have set the reproduction steps correctly and usually have the effect disabled as I find it confusing and it can give me headaches, so I haven't done too much testing.