Bug 460359 - Change GTK theme according to the global theme, i.e. Breeze (Dark) <--> Adwaita (Dark)
Summary: Change GTK theme according to the global theme, i.e. Breeze (Dark) <--> Adwai...
Status: RESOLVED WORKSFORME
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_lookandfeel (show other bugs)
Version: 5.25.5
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-13 12:42 UTC by postix
Modified: 2022-10-20 16:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot: Gtk Themes (28.38 KB, image/png)
2022-10-18 09:46 UTC, postix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description postix 2022-10-13 12:42:08 UTC
SUMMARY

Some GTK apps (as for instance Gajim 1.5.2+, Xournal++ 1.1.1+, using the setting "Dark Theme: System") do not follow the color scheme in "Global Theme --> Application Style --> GNOME/GTK Application Style".

Let's assume the GTK theme it's set to "default" or "Adwaita". If the global theme is changed from Breeze to Breeze Dark, all Qt/Plasma apps change their appearance, but the mentioned GTK app keeps using the light theme.

It'd be very convenient if the GTK themes would also change accordingly.


SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20221008
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Graphics Platform: Wayland
Comment 1 Bug Janitor Service 2022-10-13 13:34:22 UTC
Thank you for the bug report!

Please note that Plasma 5.25.5 is not supported for much longer by KDE; supported versions are 5.24, and 5.26 or newer.

If at all possible please upgrade to a supported version and verify that the bug is still happening there.
Comment 2 Nate Graham 2022-10-14 19:01:17 UTC

*** This bug has been marked as a duplicate of bug 421745 ***
Comment 3 postix 2022-10-14 19:11:42 UTC
(In reply to Nate Graham from comment #2)
> 
> *** This bug has been marked as a duplicate of bug 421745 ***

Not a duplicate, becauses restarting the app does not help here. Only changing the GTK theme in SystemSettings.
Comment 4 postix 2022-10-14 19:12:51 UTC
> Not a duplicate, becauses restarting the app does not help here. Only changing the GTK theme in SystemSettings
... works and in this case the gtk app's color changes immediately.
Comment 5 Nate Graham 2022-10-17 19:00:18 UTC
To my knowledge, there's no such theme as "Adwaita dark" that we could switch to, right? Are you saying that within the existing Adwaita theme, apps using this theme that are already known to have dark/light mode support should use switch appropriately in response to relevant changes to Global Theme changing in Plasma?
Comment 6 postix 2022-10-18 09:46:41 UTC
Created attachment 152982 [details]
Screenshot: Gtk Themes

(In reply to Nate Graham from comment #5)
> To my knowledge, there's no such theme as "Adwaita dark" that we could
> switch to, right? 

At least under openSUSE TW "Adwaita dark" came pre-installed. Will need to check it on Fedora with Plasma as well.
On Fedora 36 Gnome 42, you can switch to a dark theme as well, which is likely "Adwaita dark", since "Adwaita" is the default light theme.
Comment 7 postix 2022-10-18 09:51:46 UTC
> apps using this theme that are already known to have dark/light mode support should use switch appropriately in response to relevant changes to Global Theme changing in Plasma?

I would say so, yes or at least that'd be my usecase: In the night hours, I switch the global theme from Breeze Twilight to Breeze Dark as it feels more pleasant and it'd be great if all GTK apps would follow automatically. GTK apps, which currently do so are Thunderbird and Firefox for example.
Comment 8 Nate Graham 2022-10-18 16:36:30 UTC
On Fedora, the combobox shows:
- Breeze
- Default (which seems to map to Adwaita)
- Emacs

> GTK apps, which currently do so are Thunderbird and Firefox for example.
Are they using breeze-gtk, or their own theme?
Comment 9 postix 2022-10-18 16:41:06 UTC
(In reply to Nate Graham from comment #8)
> > GTK apps, which currently do so are Thunderbird and Firefox for example.
> Are they using breeze-gtk, or their own theme?

I see, Thunderbird and Firefox ship their own dark/light themes and just follow the system theme in this regard.
Comment 10 Nate Graham 2022-10-18 18:32:04 UTC
So the way this works is fairly complicated, and there are multiple ways it *can* work:

1. App has its own styling and behaves appropriately in response to changes to the systemwide "dark mode" setting. Examples: Thunderbird, Firefox.
2. App is styled with Adwaita + Libadwaita and behaves appropriately in response to changes to the systemwide "dark mode" setting. Example: Nautilus
3. App is styled with Breeze-GTK theme, which respects the system's active color scheme. Examples: Gedit, Inkscape
4. App uses GTK theme with hardcoded light and dark colors, and changing the Global Theme would swap between them

If I'm understanding, you're asking for 4. In fact we already do have this: global themes can indeed specify GTK themes.

But our Breeze Light and Breeze Dark global themes don't specify Adwaita, by design; they specify breeze-gtk!

So I think this is not something we can change. If the apps in question fall into categories 1 or 2 and something isn't working, then either it's an app bug, or we're not emitting changes to the global dark mode setting correctly.

If the apps in question fall into category 3, there's probably a bug in KDE code somewhere.

Can you Investigate a bit and file new bug reports? Thanks!
Comment 11 postix 2022-10-18 19:19:34 UTC
(In reply to Nate Graham from comment #10)
> Can you Investigate a bit and file new bug reports? Thanks!

I will do so!
Comment 12 postix 2022-10-19 11:38:32 UTC
It looks like an downstream issue in case of Xournal++.
For Gajim it works now, since I have changed the GTK theme setting from "Default" to "Adwaita".

On Fedora it looks like you need to install the gnome-theme-extra [1] package to make Adwaita Dark available.
[1] https://src.fedoraproject.org/rpms/gnome-themes-extra/blob/rawhide/f/gnome-themes-extra.spec
Comment 13 Nate Graham 2022-10-19 16:06:12 UTC
If there's a difference between "Default" and "Adwaita", that seems weird. Maybe worth reporting to the Fedora folks at https://pagure.io/fedora-kde/SIG/issues?
Comment 14 postix 2022-10-20 11:15:54 UTC
(In reply to Nate Graham from comment #13)
> If there's a difference between "Default" and "Adwaita", that seems weird.
That was on openSUSE TW.

> Maybe worth reporting to the Fedora folks at https://pagure.io/fedora-kde/SIG/issues?
I will check if it's reproducible on Fedora as well.
Comment 15 Nate Graham 2022-10-20 16:32:51 UTC
I had a look, and it seems like the "Adwaita" and "Adwaita Dark" themes are actually GTK2 themes. Not having them installed would indeed explain why old apps still using GTK2 didn't have the right appearance, since breeze-gtk dropped its GTK2 support a few years ago.