Bug 443104 - GTK2 programs are themed to Breeze light with Breeze GTK theme and Breeze Dark global theme
Summary: GTK2 programs are themed to Breeze light with Breeze GTK theme and Breeze Dar...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_style (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR minor
Target Milestone: ---
Assignee: Janet Blackquill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-29 05:57 UTC by Martin Tlustos
Modified: 2024-03-17 20:40 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0


Attachments
Screenshots (348.33 KB, application/octet-stream)
2022-04-05 16:45 UTC, poudinkpopinski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Tlustos 2021-09-29 05:57:20 UTC
SUMMARY
I use breeze dark mode for my laptop. Everything is fine so far, but libreoffice sub-windows like navigator remain in light mode (which makes the side icons invisible). When installing another dark theme for gtk (like nord-gtk, which is a breeze derivate), the problem is gone.

STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 poudinkpopinski 2022-04-05 16:45:12 UTC
Created attachment 147986 [details]
Screenshots

All other GTK apps I have are working fine with the default Breeze GTK theme, but I have the same issue with NP2Kai (https://github.com/AZO234/NP2kai/) and the xBRZ ScalerTest (https://sourceforge.net/projects/xbrz/files/). On top of both working fine with nord-gtk, they also both work fine with the breeze-dark-gtk theme you can get from the breeze-gtk KDE store item, which appears to simply be a slightly outdated version of the regular Breeze GTK Theme. Attached are pictures of both apps with the default Breeze GTK theme and with the breeze-dark-gtk theme.
Comment 2 poudinkpopinski 2022-04-05 17:01:30 UTC
I found a workaround. Just need to set an environment variable:
GTK2_RC_FILES="/usr/share/themes/Breeze-Dark/gtk-2.0/gtkrc"
From: https://unix.stackexchange.com/questions/512014/how-to-override-gtk-style-setting-from-kde-config-gtk-style-for-one-specific-app
Better than using a super outdated version of the theme from the KDE Store, that's for sure.
Comment 3 poudinkpopinski 2022-04-05 17:49:36 UTC
Ok, last comment.
1. I remembered more apps that don't respect the default Breeze GTK theme: bsnes-hd (https://github.com/DerKoun/bsnes-hd/) and Adobe Flash Player Standalone. Both work with breeze-dark-gtk. Flash works with the environment variable from the previous post, but bsnes-hd also needs to have the GTKRCFILE environment variable set on top of that (GTKRCFILE=Breeze-Dark).
2. Trying to set the environment variables globally doesn't work, so don't.
Comment 4 poudinkpopinski 2022-04-06 02:37:02 UTC
Okay last comment for real this time, hopefully. Better solution: Change the first line in home/.gtkrc-2.0 from gtk-theme-name="Breeze" to gtk-theme-name="Breeze-Dark". Turns out the apps that weren't working were all GTK2 apps and the issue seems to happen with all of them. This is a way better fix because it doesn't require messing with environment variables, it's global and it keeps the breeze dark icons (the environment variables changed the icon theme for some reason).
Comment 5 poudinkpopinski 2022-04-16 21:51:48 UTC
Unfortunately, seems like it isn't very reliable, after all. There's been a few times now where the GTK2 apps decided to lose their dark theme despite the .gtkrc-2.0. I don't know why it happens (maybe breeze-gtk updates?) or why it started working again. gtk-breeze-dark still works 100% of the time, tho. Too bad it's outdated.
Comment 6 Nate Graham 2022-04-21 16:48:13 UTC
Are you using LibreOffice in GTK mode or KDE mode? You can see in the "About LibreOffice" window; the text for "User Interface:" will tell you. What's it set to?
Comment 7 Bug Janitor Service 2022-05-06 04:35:07 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 8 Martin Tlustos 2022-05-06 07:11:53 UTC
It uses kf5, so KDE mode.
Comment 9 Martin Tlustos 2022-05-06 07:19:03 UTC
Ok, so I checked whether it started working: I reverted .gtkrc-2.0 back to using "breeze" as icons, selected breeze as gtk theme in system settings, and selected "automatic" in libreoffice for icon use in Settings-View. Voilá - it works! Maybe someone else can confirm it?
Comment 10 Martin Tlustos 2022-05-06 07:21:12 UTC
Just found out: as a side effect right-click menus in firefox have reverted to breeze-light style... ;-) No big deal, though...
Comment 11 Mors Mortium 2022-12-03 15:48:01 UTC
This still happens with GTK2 apps (Pidgin, GTKTTK TTK themer (every TK program: PySolFC, gitk), K-3D, Gimp). Using breeze-dark-gtk solves it, but that's not the official theme. Modifying ~/.gtkrc-2.0 to contain gtk-theme-name="Breeze-Dark" solves it as long as some setting resets it, but this would be the ideal solution.
Comment 12 Fushan Wen 2023-09-29 14:03:42 UTC
Git commit daca2c210dd399f7acaeecf2849319be46da347a by Fushan Wen, on behalf of Mors Mortium.
Committed on 29/09/2023 at 16:03.
Pushed by fusionfuture into branch 'master'.

Fix GTK2 dark theme

M  +14   -2    kded/gtkconfig.cpp
M  +1    -0    kded/gtkconfig.h

https://invent.kde.org/plasma/kde-gtk-config/-/commit/daca2c210dd399f7acaeecf2849319be46da347a