n4n0GH / hello

the complete KDE theme
219 stars 26 forks source link

[BUG] Custom title bar colors not working for Spotify #71

Closed nihadguluzade closed 4 years ago

nihadguluzade commented 4 years ago

Describe the bug In the settings, from the Window-Specific Overrides tab I add the Spotify app (Window Class Name is Spotify), pick the custom title bar colour and apply it. Although it does change the title bar color of the currently opened Spotify application, the color gets back to normal after restarting/reopening the application.

To Reproduce

  1. Open Spotify and the hello settings.
  2. Add the Spotify app to the Window-Specific Overrides tab.
  3. Pick a custom color for the title bar.
  4. Close and open the Spotify again, the title bar colour will revert back to original.

Expected behavior The custom title bar color of the Spotify should stay when reopening the application.

Additional context Using KDE Plasma Version 5.17.5, openSUSE Tumbleweed 20200123.

n4n0GH commented 4 years ago

Okay this is a bit tricky.

The color is being calculated when the window is first created. The custom rules will apply to a window that's called "Spotify", but not to a window that's first called "Snap App" and then later renames itself to "Spotify". A similar issue arises when you try to create a custom rule set for incognito Firefox windows.

Can you do me a favor and try something out though? After creating this rule for Spotify, close and then reopen Spotify to see that it in fact didn't change color. Then open up krunner and type kwin_x11 --replace and hit enter. The Spotify window should have the proper color now.

If this works, a possible solution would be to add a delay to the functions before they fetch the application properties if that's even possible from within the window decorations.

nihadguluzade commented 4 years ago

krunner command indeed changed the title bar color for the currently opened Spotify. Probably it might be related to the title name changing, because when I start the program title bar is first "Spotify" then changes to "Spotify Premium". However, as I said, from the settings of hello, I chose Matching windows property to the Window class name, not the Window title.

n4n0GH commented 4 years ago

Yes, but something changes from the initial rendering of the window to when you can actually use it. So I guess a delay in detecting the window properties is the only way to circumvent this. Hm.

rdrms commented 4 years ago

Just leaving a brief comment to say that I'm experiencing this, and would offer to test any solutions you have. Opening and closing Hello settings causes the window manager to "refresh" or something, i see a flash on my screen and then spotify changes to the right titlebar color.

n4n0GH commented 4 years ago

Upon closing the window decoration settings Plasma is essentially doing a refresh. So the flash you see is exactly what you'd get when you'd do a kwin_x11 --replace.

n4n0GH commented 4 years ago

Closing this as I most likely won't be working on this any further (see 5f57998e).