Bug 448877

Summary: kde-gtk-config doesn't work as expected when switching preferred color scheme.
Product: [Plasma] Breeze Reporter: Emilio Cobos Álvarez (:emilio) <emilio>
Component: gtk themeAssignee: Janet Blackquill <uhhadd>
Status: CONFIRMED ---    
Severity: normal CC: azrdev, bharadwaj.raju777, hujq, nate, peter, plasma-bugs, postix
Priority: NOR    
Version: master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: firefox-nightly-log.txt

Description Emilio Cobos Álvarez (:emilio) 2022-01-21 13:03:40 UTC
SUMMARY

See the discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1734934#c17 and following. STR are just having Firefox or other GTK apps with the breeze theme and switching color-scheme.

I think there are various issues in the kde-gtk-module:

 * I _think_ `ConfigEditor::addImportStatementsToGtkCssUserFile` is unnecessary, since the colorreload module will also load the colors.css file. Worse, it prevents colorreload from actually doing its job, since the `gtk.css` loaded statements won't be removed. This causes Firefox and other GTK apps need a full restart to see theme changes.

 * `GtkConfig::setDarkThemePreference` is not harmful, but seems redundant with the newer portal-based settings.

 * The default Breeze theme doesn't react to the `gtk-application-prefer-dark-theme` setting, since it will use the colors from `colors.css` unconditionally.

All these issues cause GTK apps seem less polished than they should, even though there's nothing those apps can realistically do to avoid it.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 36
KDE Plasma Version: 5.23.90
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.17.0-0.rc0.20220112gitdaadb3bd0e8d.63.fc36.x86_64 (64-bit)
Graphics Platform: Wayland
Comment 1 Bharadwaj Raju 2022-01-21 15:58:52 UTC
Created attachment 145717 [details]
firefox-nightly-log.txt

Log of what Firefox Nightly outputs with MOZ_LOG=LookAndFeel:5 as I change the colorscheme back and forth. Might be useful. Done on nonexistent profile.
Comment 2 Nate Graham 2022-05-17 19:01:07 UTC
Please feel free to submit merge requests to fix these issues, Emilio!
Comment 3 Emilio Cobos Álvarez (:emilio) 2022-05-20 11:21:21 UTC
Yeah, happy to, it's on my list of things to get to. I realized it's a bit trickier because on Wayland GTK doesn't load the colorreload module, so it's not so straight-forward unfortunately.

Improving the breeze theme to react to the dark theme setting should be doable and would be a massive improvement tho, I just need to find the time to figure out the best solution for that.
Comment 4 Nate Graham 2022-05-21 17:28:30 UTC
Great, I look forward to it!