GTK4 apps lauched at startup do not use system color-scheme / theme properly
Compositor
- [x] niri
- [ ] Hyprland
- [ ] Other (specify)
Description
YaLTeR/niri#2492, duplicated here to check if misconfiguration (as per niri author), is due to DMS.
When I start a GTK4 app that works normally ( live reloading of GTK dark/light theme ) after the compositor and shell starts through the spawn-at-startup niri config, the theme switch do not affect that app.
Expected Behavior
- Start the app normally from shell or compositor, it works properly.
- Start the app as startup app with
spawn-at-startup, live theming (even proper theming) is broken.
Steps to Reproduce
- Add
spawn-at-startup "/path/to/GTK4/app"in config - Start a new session
- That specific GTK4 app doesn't load proper theme.
- Close or Kill the GTK4 app
- Reopen the GTK4 app
- Live / Dynamic Theming works properly.
Screenshots/Recordings
I think it's related to the way you start niri, how do you start it? niri-session shouldn't have this issue.
I run it through niri-session from tty or greetd-tuigreet. Currently I run it through dms greetd greeter. I have also ran it with sddm.
I believe it's either a race between some service startup and gtk app or some environment variable not being setup at startup when the app spawns as it works if I put some delay in the app startup.
Can you replicate this? It doesn't work with nautilus but with pantheon-polkit-agent or soteria-git or gtk4-demos and maybe other simple gtk4 apps from arch/aur.
For polkit after login I use pkexec whoami to bring up the dialog which doesn't follow proper theme and is unresponsive to color-scheme changes (light/dark) mode.
After finding this bug in the default config of niri, I don't believe this is a issue due to DMS config. However, I would like it to be solved (or discussed) before it closes as the issue in niri has been prematurely closed.
There have been many updates towards theming / paths to use etc over the past few days. Can you see if this is still an issue for you in the newest build?
Yes, it is still an issue. I think this is an issue with niri or something else because this happens even in minimal niri config. However I'm not sure due to what. Niri author says probably a race condition but has closed the issue for now.
I just want to know whether this is applicable or replicable by others or not. If it is then it is certainly a bug.
This space too has seen more updates, checking in to see if it's still the same on your end?
No longer a problem for me now. But I don't know if updates were responsible or changing login shell to zsh and its config were responsible.