Bug 495063

Summary: Contents of newly focused window appear inactive when using color scheme with inactive effects
Product: [Plasma] kwin Reporter: Timothy B <yule2000>
Component: tabboxAssignee: KWin default assignee <kwin-bugs-null>
Status: REPORTED ---    
Severity: normal Keywords: regression
Priority: NOR    
Version First Reported In: 6.2.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: (Modified) Catppuccin Latte color scheme
Breeze Light color scheme

Description Timothy B 2024-10-19 22:28:42 UTC
SUMMARY
When you switch to a Qt-based window using the task switcher, contents of that window appear to be inactive despite already being focused. This is most noticeable if the desktop color scheme has inactive effects enabled.

STEPS TO REPRODUCE
0. In System Settings, change the color scheme to one that already has inactive effects. (In my case, I used one of the Catppuccin color schemes available on the KDE Store.)
1. Open at least 1 KDE app or Qt-based app
2. Click on another window or the desktop, or minimize the active window
3. Using only keyboard shortcuts (usually Alt+Tab), activate the task switcher and select a Qt-based window on the list that is not focused
4. Release the keys and note the appearance of the newly focused window

OBSERVED RESULT
All elements in the active window inside the window decoration appear dim/darkened as if the window is still not focused

EXPECTED RESULT
All elements in the active window do not appear dim, darkened, or use other inactive effects; their colors have better contrast depending on the color scheme

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS 
KDE Plasma Version: 6.2.1
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Graphics Platform: Wayland
Graphics Processor: AMD Radeon RX 6750 XT
Graphics Driver: Mesa 24.2.4 (AMDGPU)

ADDITIONAL INFORMATION
I first encountered this after upgrading Plasma to version 6.2.0 a few days after release (at that time, Frameworks was still at version 6.6 and Qt at version 6.7). I never saw this behavior occur prior to Plasma 6.2. It only affects apps built with Qt, and it doesn't matter if the window uses QtQuick or traditional widgets.

One workaround that works every time is to click on the window you want to switch to instead of selecting it with keyboard shortcuts per step 3 above. Another workaround is to use a color scheme that does not use inactive effects (such as any of the default Breeze color schemes), though the app header background in KDE apps does not match the titlebar background after following the reproduction steps above.

Switching between virtual desktops using any method such as keyboard shortcuts and Overview does not trigger this bug.

Clicking on any of the elements does not make the colors revert back to normal, but they do so after you open and close a menu popup from either the window decoration, the menu bar, or any toolbar.
Comment 1 Timothy B 2024-10-19 22:32:12 UTC
Created attachment 175039 [details]
(Modified) Catppuccin Latte color scheme

Note the dim text on the menubar and toolbar as well as the mismatch between the background colors of the titlebar and the menubar/toolbar
Comment 2 Timothy B 2024-10-19 22:32:48 UTC
Created attachment 175040 [details]
Breeze Light color scheme
Comment 3 Timothy B 2024-10-21 23:43:56 UTC
I would like to add that switching between application styles in System Settings (e.g., Breeze, Fusion, Kvantum) doesn't make the bug go away, so at least this doesn't look like a problem specific to Breeze.