Bug 428842 - Window decoration buttons change to look worse until re-selecting GTK theme
Summary: Window decoration buttons change to look worse until re-selecting GTK theme
Status: RESOLVED FIXED
Alias: None
Product: Breeze
Classification: Plasma
Component: gtk theme (show other bugs)
Version: 5.20.2
Platform: Manjaro Linux
: VHI normal
Target Milestone: ---
Assignee: Mikhail Zolotukhin
URL:
Keywords: regression
: 428893 429094 429982 429984 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-11-08 14:38 UTC by Александр
Modified: 2020-12-12 14:36 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.20.5


Attachments
photo strange and normal buttons (23.17 KB, application/zip)
2020-11-08 14:38 UTC, Александр
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Александр 2020-11-08 14:38:14 UTC
Created attachment 133149 [details]
photo strange and normal buttons

SUMMARY



STEPS TO REPRODUCE
1. Set theme in gtk breeze 
2. Restart computer
3. Open gtk application. For instance, Firefox. 

OBSERVED RESULT
I see other buttons close, restore, minimize.

EXPECTED RESULT
I must see usual buttons.

In attachment you can see two picture. One photo is OBSERVED RESULT. Two photo is EXPECTED RESULT.

But if I again set breeze theme in gtk and restart Firefox(or other gtk application) then i see normal button. After restart pc again buttons strange. 

It is very strange, because on my laptop is ok but on my pc have this bug.

SOFTWARE/OS VERSIONS

Operating System: Manjaro Linux
KDE Plasma Version: 5.20.2
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1
Kernel Version: 5.4.74-1-MANJARO
OS Type: 64-bit
Processors: 16 × AMD Ryzen 7 3700X 8-Core Processor
Memory: 15.6 GiB of RAM
Graphics Processor: AMD OLAND

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2020-11-09 17:47:40 UTC
Works for me FWIW.
Comment 2 Александр 2020-11-09 18:52:27 UTC
(In reply to Nate Graham from comment #1)
> Works for me FWIW.

What is FWIW?
Comment 3 Nate Graham 2020-11-09 18:53:12 UTC
"For What It's Worth", sorry for using internet jargon. :)
Comment 4 Nate Graham 2020-11-16 20:07:34 UTC
*** Bug 428893 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2020-11-16 20:07:43 UTC
*** Bug 429094 has been marked as a duplicate of this bug. ***
Comment 6 Skeleton221 2020-11-16 20:17:38 UTC
from what I understand, the problem only appears when changing the style of plasma applications.
see here:
https://www.reddit.com/r/kde/comments/jste1a/how_can_i_reinstall_kde_without_deleting_my/gcdp3wo/

this is what i wrote on reddit:


I have understand what happens, but i can't fix it without a script.

inside the ~/.config/gtk-3.0/window_decorations.css file there are written the paths of the buttons to use for the theme, but the path is not complete (it is normal), an example: https://i.imgur.com/NOUJXpl.png

"background-image: url("assets/close-active.svg"); }"

from what I understand, plasma does not provide the initial part of the path(in an environmental variable probably), and therefore the application directly takes the icons that are present in: ~/.config/gtk-3.0/assets/

I'm sure of this because if I delete the assets folder present in.config/gtk-3.0/, the buttons no longer appear while I have the fraken theme, but they appear if the theme works correctly (this is because it no longer uses the button icons present in .config/gtk....).



i also found a way to fix it momentarily via a script(not a permanent solution)
Comment 7 Александр 2020-11-17 05:13:54 UTC
(In reply to Skeleton221 from comment #6)
> from what I understand, the problem only appears when changing the style of
> plasma applications.
> see here:
> https://www.reddit.com/r/kde/comments/jste1a/
> how_can_i_reinstall_kde_without_deleting_my/gcdp3wo/
> 
> this is what i wrote on reddit:
> 
> 
> I have understand what happens, but i can't fix it without a script.
> 
> inside the ~/.config/gtk-3.0/window_decorations.css file there are written
> the paths of the buttons to use for the theme, but the path is not complete
> (it is normal), an example: https://i.imgur.com/NOUJXpl.png
> 
> "background-image: url("assets/close-active.svg"); }"
> 
> from what I understand, plasma does not provide the initial part of the
> path(in an environmental variable probably), and therefore the application
> directly takes the icons that are present in: ~/.config/gtk-3.0/assets/
> 
> I'm sure of this because if I delete the assets folder present
> in.config/gtk-3.0/, the buttons no longer appear while I have the fraken
> theme, but they appear if the theme works correctly (this is because it no
> longer uses the button icons present in .config/gtk....).
> 
> 
> 
> i also found a way to fix it momentarily via a script(not a permanent
> solution)

No. I don't change theme. I just reboot pc and appear this icons. 

In order to fix these icons, I have to change the theme, then everything is fine, but after a reboot again the same problem.
Comment 8 Skeleton221 2020-11-17 14:22:16 UTC
(In reply to Александр from comment #7)
> No. I don't change theme. I just reboot pc and appear this icons. 
> 
> In order to fix these icons, I have to change the theme, then everything is
> fine, but after a reboot again the same problem.

if you want, you can use this script to "fix" the problem momentarily:
https://www.dropbox.com/s/2xmk2ui76curawz/gtk.sh?dl=0
You have to put it in ~/.config/autostart-scripts/


As for the problem: how long ago did you install manjaro? I didn't have this problem before trying to change the style of the applications, but mine is an old installation.
Comment 9 stpaulgym@protonmail.com 2020-11-17 15:49:59 UTC
(In reply to Skeleton221 from comment #8)
> (In reply to Александр from comment #7)
> > No. I don't change theme. I just reboot pc and appear this icons. 
> > 
> > In order to fix these icons, I have to change the theme, then everything is
> > fine, but after a reboot again the same problem.
> 
> if you want, you can use this script to "fix" the problem momentarily:
> https://www.dropbox.com/s/2xmk2ui76curawz/gtk.sh?dl=0
> You have to put it in ~/.config/autostart-scripts/
> 
> 
> As for the problem: how long ago did you install manjaro? I didn't have this
> problem before trying to change the style of the applications, but mine is
> an old installation.

Apologies for the late response. This was when the sysem was newly installed. It also seems to happen on EndeavourOS(Arch) as well.

Due to other bugs with Plasman, I have reverted back to gnome for now. However,  this was a repeatable bug that happened with a 100% success rate
Comment 10 Александр 2020-11-18 05:09:40 UTC
(In reply to Skeleton221 from comment #8)
> (In reply to Александр from comment #7)
> > No. I don't change theme. I just reboot pc and appear this icons. 
> > 
> > In order to fix these icons, I have to change the theme, then everything is
> > fine, but after a reboot again the same problem.
> 
> if you want, you can use this script to "fix" the problem momentarily:
> https://www.dropbox.com/s/2xmk2ui76curawz/gtk.sh?dl=0
> You have to put it in ~/.config/autostart-scripts/
> 
> 
> As for the problem: how long ago did you install manjaro? I didn't have this
> problem before trying to change the style of the applications, but mine is
> an old installation.

I installed manjaro in December 2019 year.
Comment 11 Александр 2020-11-18 05:13:45 UTC
(In reply to Skeleton221 from comment #8)
> (In reply to Александр from comment #7)
> > No. I don't change theme. I just reboot pc and appear this icons. 
> > 
> > In order to fix these icons, I have to change the theme, then everything is
> > fine, but after a reboot again the same problem.
> 
> if you want, you can use this script to "fix" the problem momentarily:
> https://www.dropbox.com/s/2xmk2ui76curawz/gtk.sh?dl=0
> You have to put it in ~/.config/autostart-scripts/
> 
> 
> As for the problem: how long ago did you install manjaro? I didn't have this
> problem before trying to change the style of the applications, but mine is
> an old installation.

Is it normal what your script  forever repeat with 0.5 sec pause? 🤔🤔🤔🤔🤔
Comment 12 Skeleton221 2020-11-18 14:22:44 UTC
(In reply to Александр from comment #11)
> Is it normal what your script  forever repeat with 0.5 sec pause? 🤔🤔🤔🤔🤔

repeats the command until it has succeeded in setting the theme. 


this is the way to set the gtk theme from terminal: 
qdbus org.kde.GtkConfig /GtkConfig org.kde.GtkConfig.setGtkTheme $(grep "gtk-theme-name" ~/.config/gtk-3.0/settings.ini | cut -d'=' -f2)

this takes the name of the theme it has to set:
grep "gtk-theme-name" ~/.config/gtk-3.0/settings.ini | cut -d'=' -f2

this stops the repetition if the command worked:
[ "$?" = "1" ] || break


since at the start of the user session not everything has been loaded, but it takes a few seconds (depending on the pc), in this way it repeats the command until it works.

another way is to add some delay before the command starts:
sleep 20 ; qdbus org.kde.GtkConfig /GtkConfig org.kde.GtkConfig.setGtkTheme "Breeze-dark-gtk"
but it is not an accurate way, as the time varies from pc to pc.
Comment 13 Toadfield 2020-11-28 01:17:50 UTC
I had a problem like this some months ago,the script fixed it (I don't know what caused this bug).
Now after changing some themes I have this bug again,but even after setting the themes back to "Breeze-Dark" for qt and "Breeze-Dark-Gtk" for Gtk it's still there and the script doesn't work.
I'm on Manjaro.
Comment 14 Александр 2020-11-28 06:35:05 UTC
(In reply to Skeleton221 from comment #12)
> (In reply to Александр from comment #11)
> > Is it normal what your script  forever repeat with 0.5 sec pause? 🤔🤔🤔🤔🤔
> 
> repeats the command until it has succeeded in setting the theme. 
> 
> 
> this is the way to set the gtk theme from terminal: 
> qdbus org.kde.GtkConfig /GtkConfig org.kde.GtkConfig.setGtkTheme $(grep
> "gtk-theme-name" ~/.config/gtk-3.0/settings.ini | cut -d'=' -f2)
> 
> this takes the name of the theme it has to set:
> grep "gtk-theme-name" ~/.config/gtk-3.0/settings.ini | cut -d'=' -f2
> 
> this stops the repetition if the command worked:
> [ "$?" = "1" ] || break
> 
> 
> since at the start of the user session not everything has been loaded, but
> it takes a few seconds (depending on the pc), in this way it repeats the
> command until it works.
> 
> another way is to add some delay before the command starts:
> sleep 20 ; qdbus org.kde.GtkConfig /GtkConfig org.kde.GtkConfig.setGtkTheme
> "Breeze-dark-gtk"
> but it is not an accurate way, as the time varies from pc to pc.

Ok.Thanks! But this script didn't help me(
Comment 15 Александр 2020-11-28 06:36:04 UTC
(In reply to Toadfield from comment #13)
> I had a problem like this some months ago,the script fixed it (I don't know
> what caused this bug).
> Now after changing some themes I have this bug again,but even after setting
> the themes back to "Breeze-Dark" for qt and "Breeze-Dark-Gtk" for Gtk it's
> still there and the script doesn't work.
> I'm on Manjaro.

Yeah. I am not alone with this problem)
Comment 16 Bug Janitor Service 2020-11-29 00:35:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kde-gtk-config/-/merge_requests/17
Comment 17 Toadfield 2020-11-29 17:25:41 UTC
I also have this bug on my laptop,there my gtk programs look transparent and buggy until I re-select my theme.
My pc is fully amd and my laptop has intel cpu and nvidia gpu.
I have installed Manjaro on both.
Comment 18 Александр 2020-11-29 17:31:26 UTC
(In reply to Toadfield from comment #17)
> I also have this bug on my laptop,there my gtk programs look transparent and
> buggy until I re-select my theme.
> My pc is fully amd and my laptop has intel cpu and nvidia gpu.
> I have installed Manjaro on both.

When did the bug appear?
Comment 19 Toadfield 2020-11-30 00:42:59 UTC
(In reply to Александр from comment #18)
> (In reply to Toadfield from comment #17)
> > I also have this bug on my laptop,there my gtk programs look transparent and
> > buggy until I re-select my theme.
> > My pc is fully amd and my laptop has intel cpu and nvidia gpu.
> > I have installed Manjaro on both.
> 
> When did the bug appear?

On my Laptop since I installed my Distro there yesterday.
On my pc,since some days.
Comment 20 Nate Graham 2020-12-03 19:32:28 UTC
*** Bug 429984 has been marked as a duplicate of this bug. ***
Comment 21 Mikhail Zolotukhin 2020-12-03 19:57:51 UTC
*** Bug 429982 has been marked as a duplicate of this bug. ***
Comment 22 Michał Dybczak 2020-12-04 18:57:42 UTC
I can confirm this bug on my system as well. I believe it came with Plasma 5.20. I'm waiting for the 5.20.5 update to see if it fixes it.

So far the best way to deal with it is to delete ~/.config/gtk-3.0/ and not change themes, then the correct buttons of the gtk theme stick.
Comment 23 Toadfield 2020-12-09 15:00:08 UTC
(In reply to Michał Dybczak from comment #22)
> So far the best way to deal with it is to delete ~/.config/gtk-3.0/ and not
> change themes, then the correct buttons of the gtk theme stick.

Thanks,but the problem is that I like to change my theme often.
Comment 24 Toadfield 2020-12-11 21:53:59 UTC
I have noticed that re selecting the theme doesn't change anything for firefox for example,so it looks buggy even after re selecting the gtk theme.
This doesn't happen on programs like Pamac.
Could that be cause Firefox is a gtk2 program?
Comment 25 Александр 2020-12-12 05:46:30 UTC
(In reply to Toadfield from comment #24)
> I have noticed that re selecting the theme doesn't change anything for
> firefox for example,so it looks buggy even after re selecting the gtk theme.
> This doesn't happen on programs like Pamac.
> Could that be cause Firefox is a gtk2 program?

Did you make restart program pamac after change theme?
Comment 26 Toadfield 2020-12-12 14:36:08 UTC
(In reply to Александр from comment #25)
> (In reply to Toadfield from comment #24)
> > I have noticed that re selecting the theme doesn't change anything for
> > firefox for example,so it looks buggy even after re selecting the gtk theme.
> > This doesn't happen on programs like Pamac.
> > Could that be cause Firefox is a gtk2 program?
> 
> Did you make restart program pamac after change theme?

yes