Summary: | GTK2 theming broken after update to Plasma 5.19 | ||
---|---|---|---|
Product: | [Applications] systemsettings | Reporter: | Jerzy Witwinowski <locutus> |
Component: | kcm_style | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | edisonalvaringo, linux, mail, nate, pizzadude, plasma-bugs, uhhadd, zawertun |
Priority: | NOR | Keywords: | regression |
Version: | 5.18.5 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=430046 | ||
Latest Commit: | https://invent.kde.org/plasma/plasma-desktop/commit/d9d49d5c8f831a289401c50470a46a2cd5778faa | Version Fixed In: | 5.20 |
Sentry Crash Report: | |||
Attachments: |
GTK2 apps before opening the preview window
GTK2 apps when the preview window is opened GTK2 apps after the preview window was closed |
Description
Jerzy Witwinowski
2020-06-18 08:20:35 UTC
I have this issue on one of my machines, Fedora 32 KDE with zawertun's copr for latest KDE. On my other machine, I don't have this issue. It should be worth noting that both machines (affected and unaffected) are the same distro and copr repo. The problem now exists on both computers after trying to change the theme as a test, but good news! I found a workaround. Add this to ~/.profile, ~/.bashrc, and if you use fish shell, ~/.config/fish/config.fish export GTK2_RC_FILES=/usr/share/themes/Breeze-Dark/gtk-2.0/gtkrc export GTK_DATA_PREFIX="" You can change Breeze-Dark to the theme you like. Here and in the whole office computeres the same. hi I'm seeing this behaviour on plasma 5.18 kubuntu 20.04 default, I updated something and got broke, not sure what broke the system, maybe it is not a bug with plasma rather a bug of some component of the system not sure. the bug looks the same as you, if I use the preview window the gtk2 theme applies but I think that I don't know why, but the gtk2 apps are trying to use the gtk3 theme instead, maybe they are defaulting to the gtk3 theme for some reason I don't know. If I change the file in .config/gtk-3.0/settings , it doesn't work, I don't know where the gtk2 apps are reading the theme settings. the workaround that "p d" mentions doesn't work for me lxappareance doesn't work also, but gtk-chtheme DOES WORK! so another thing I noticed, gtk-chtheme works but as long as you launch the apps from the menu, if you launch them using a command from terminal of from the drop down launcher it doesn't work. This is clearly a variable that's messing up the system. But I don't know where to look it's not .bashrc, nor .profile nor, gtk-2.0 nor gtk-2.0-kde4 Cannot reproduce on openSUSE Tumbleweed. Where is the Raileigh theme coming from? I don't think it's installed by default on Neon. Could someone attach a screenshot, or even better, a screen recording of this happening? this is on ubuntu focal using kde from archive.kde.neon.org, as you can see the gtk2 theme is defaulting to the gtk3 version instead of using the gtk2 one. If it helps also on konsole I get this error when launching gtk2 apps, Gtk-CRITICAL **: 17:58:56.783: IA__gtk_widget_set_colormap: assertion '!gtk_widget_get_realized (widget)' failed https://drive.google.com/file/d/1aMfSg57QvzOE4S_DwTbCkExmy0oPsER_/view?usp=sharing (In reply to edisonalvaringo from comment #10) > this is on ubuntu focal using kde from archive.kde.neon.org FWIW that's not a supported configuration and as such it confuses the issue because now I don't know if it's a real problem in the code or a local misconfiguration. See https://neon.kde.org/faq. (In reply to Nate Graham from comment #11) > (In reply to edisonalvaringo from comment #10) > > this is on ubuntu focal using kde from archive.kde.neon.org > FWIW that's not a supported configuration and as such it confuses the issue > because now I don't know if it's a real problem in the code or a local > misconfiguration. > See https://neon.kde.org/faq. yes but it also happens on kubuntu 20.04 lts default, I had to try a different configuration just in case. Created attachment 129829 [details]
GTK2 apps before opening the preview window
As asked by Nate Graham - I provide a series of three screenshots documenting the bug.
Created attachment 129830 [details]
GTK2 apps when the preview window is opened
As asked by Nate Graham - I provide a series of three screenshots documenting the bug.
Created attachment 129831 [details]
GTK2 apps after the preview window was closed
As asked by Nate Graham - I provide a series of three screenshots documenting the bug.
I added the screenshots, as Nate Graham asked. I also wanted to confirm that for me the workaround proposed by p d (setting the system variable GTK2_RC_FILES) works. Thanks, that's helpful. It's also really weird. Carson or Mikhail, any ideas here?? This "bug" is happening, because GTK2 applications are using the theme provided by GTK3 setting, because the latter sets itself in xsettingsd.conf file. And xsettings does not have a separate settings for GTK2 and GTK3 applications (therefore it applies the theme from the config to both). Therefore, unfortunately, this is unfixable. It's also one of the reasons why I wanted to merge GTK2 and GTK3 theme setting into one in the UI. If the OP really want to use separate themes for GTK2 and GTK3 applications (which are rare these days if the themes are new), they can uninstall the xsettingsd daemon. But please note, that this action makes it impossible to change the theme and other settings (such as fonts, icons etc.) for GTK applications on the fly, i.e. without restarting them, Or the OP can just use one theme for GTK2 and GTK3 applications. I can confirm removing xsettingsd fixes the issue for me. > It's also one of the reasons why I wanted to merge GTK2 and GTK3 theme setting into one in the UI.
Was there some blocker preventing that? Sounds like it could be a good solution if otherwise users will hit this unfixable bug.
The old diffs were here https://phabricator.kde.org/D29749 and there https://phabricator.kde.org/D29748 If I understood correctly, the main reasons the diff was abordoned were the UI and the fact, that there are still some major apps, that use GTK2 (GIMP and Audacity). I started a work on a list-based GTK theme selection some time ago, but it is unfinished and somewhat hacky on the Kirigami/QML side, since we do not have the exact needed component. Currently I don't have enough time to fully implement the idea, but I can create merge requests on Invent from the old diffs, I have one question as a person whose informatics skills are limited to writing simple scripts in Perl or Python: why this bug is impossible to correct? Can't you just roll back to the solution that was used until Plasma 5.18? It's better to have to restart GTK2 apps to see the theme applied than to never see the theme applied at all, isn't it? Or maybe you could just implement the p d workaround - modifying the kde-gtk-config package so that it sets correctly the GTK2_RC_FILES system variable should be like two lines of code. An ugly solution is still better than no solution at all... And finally if clicking the preview button correctly sets the theme, can't the code be modified so that whatever hitting the preview button does to the system stays that way after the preview window is closed? It's impossible to fix keeping the existing functionality, i.e. changing the settings of the GTK apps without restarting them, using xsettingsd. More over GTK2 is deprecated, I do not want to sacrifice the UX and features to support the rare use case, where the themes for GTK applications depend on the framework version, and what's even more, where one version is too old and still used by 1-2 applications (Audacity (via wxWidgets) and GIMP), that still for some reason cannot port themselves to the newer version of the framework they are using during all these years (9 years since GTK3 release, I think). Regarding the previews: GTK2 one uses a hack: it stops xsettingsd before launching and starts it after closing the preview. This cannot be used for applications, that stay open during a long period of time, because this behavior breaks "on the fly settings changing" feature. (In reply to Mikhail Zolotukhin from comment #21) > The old diffs were here https://phabricator.kde.org/D29749 and there > https://phabricator.kde.org/D29748 Given the information you've provided here, I think we should do that. Maybe you can re-open those or put them in GitLab? Inkscape just had its 1.0 release and now uses GTK3 so that pretty much just leaves GIMP. There are other apps, old apps that use GTK2, I'm not a dev just a user, just my two cents, but what about something in the middle solution? removing the gtk2 theming options seems reasonable, but maybe more advance users with not so common apps will still want to theme GTK2 their way, I have two apps here in my desktop WinFF and Palemoon that use GTK2. What about disabling theming by default, but adding a config hidden setting that will allow individual gtk2 theming? maybe that can be changed with a setting in "rc" text file and add a warning about xsettings incompatibility in the comments sections of that file. just my two cents. anyway people using old gtk2 apps could still use gtk-chtheme, and remove xsettings, what I said it's like a cornercase . (In reply to Nate Graham from comment #24) > Given the information you've provided here, I think we should do that. Maybe > you can re-open those or put them in GitLab? > > Inkscape just had its 1.0 release and now uses GTK3 so that pretty much just > leaves GIMP. Done. https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/54 https://invent.kde.org/plasma/kde-gtk-config/-/merge_requests/7 Git commit 9323a96a9e7ec93f735e10ee671c3824b35429df by Mikhail Zolotukhin. Committed on 21/07/2020 at 15:18. Pushed by gikari into branch 'master'. Provide an unified interface for setting GTK theme GTK configuration in Plasma depends on xsettings daemon, that has no separation between GTK2 and GTK3 theme, therefore separate themes for GTK2 and GTK3 are impossible, while this daemon is working. The daemon itself provides the functionality to apply settings to GTK applications without restarting them. The functionality to apply different themes to applications, depending on the framework version isn't necessary, when 99% of the themes are compatible with both versions and when most of the applications are using the last GTK version anyway. Given all that, I think, that a theme selection must be narrowed to one and only one theme for both versions of the GTK framework. M +0 -1 CMakeLists.txt D +0 -12 gtkproxies/CMakeLists.txt D +0 -130 gtkproxies/preview.c D +0 -576 gtkproxies/preview.ui D +0 -71 gtkproxies/reload.c M +21 -1 kconf_update/gtktheme.cpp M +3 -28 kded/configeditor.cpp M +0 -2 kded/configeditor.h M +3 -17 kded/gtkconfig.cpp M +3 -8 kded/gtkconfig.h M +0 -60 kded/themepreviewer.cpp M +0 -10 kded/themepreviewer.h https://invent.kde.org/plasma/kde-gtk-config/commit/9323a96a9e7ec93f735e10ee671c3824b35429df Git commit d9d49d5c8f831a289401c50470a46a2cd5778faa by Mikhail Zolotukhin. Committed on 21/07/2020 at 15:19. Pushed by gikari into branch 'master'. [GTK Integration] Apply the same theme for GTK2 and GTK3 applications GTK configuration in Plasma depends on xsettings daemon, that has no separation between GTK2 and GTK3 theme, therefore separate themes for GTK2 and GTK3 are impossible, while this daemon is working. The daemon itself provides the functionality to apply settings to GTK applications without restarting them. The functionality to apply different themes to applications, depending on the framework version isn't necessary, when 99% of the themes are compatible with both versions and when most of the applications are using the last GTK version anyway. Given all that, I think, that a theme selection must be narrowed to one and only one theme for both versions of the GTK framework. M +1 -1 kcms/style/CMakeLists.txt D +0 -34 kcms/style/gtk2_themes.knsrc R +1 -1 kcms/style/gtk_themes.knsrc [from: kcms/style/gtk3_themes.knsrc - 095% similarity] M +13 -39 kcms/style/gtkpage.cpp M +7 -14 kcms/style/gtkpage.h M +1 -17 kcms/style/gtkthemesmodel.cpp M +1 -2 kcms/style/gtkthemesmodel.h M +17 -95 kcms/style/package/contents/ui/GtkStylePage.qml https://invent.kde.org/plasma/plasma-desktop/commit/d9d49d5c8f831a289401c50470a46a2cd5778faa |