DankMaterialShell icon indicating copy to clipboard operation
DankMaterialShell copied to clipboard

GTK4 apps lauched at startup do not use system color-scheme / theme properly

Open AC17dollars opened this issue 1 year ago • 6 comments

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

  1. Start the app normally from shell or compositor, it works properly.
  2. Start the app as startup app with spawn-at-startup, live theming (even proper theming) is broken.

Steps to Reproduce

  1. Add spawn-at-startup "/path/to/GTK4/app" in config
  2. Start a new session
  3. That specific GTK4 app doesn't load proper theme.
  4. Close or Kill the GTK4 app
  5. Reopen the GTK4 app
  6. Live / Dynamic Theming works properly.

Screenshots/Recordings

Image

AC17dollars avatar Oct 01 '25 16:10 AC17dollars

I think it's related to the way you start niri, how do you start it? niri-session shouldn't have this issue.

bbedward avatar Oct 03 '25 20:10 bbedward

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.

AC17dollars avatar Oct 04 '25 01:10 AC17dollars

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?

purian23 avatar Oct 07 '25 01:10 purian23

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.

AC17dollars avatar Oct 07 '25 06:10 AC17dollars

This space too has seen more updates, checking in to see if it's still the same on your end?

purian23 avatar Oct 27 '25 00:10 purian23

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.

AC17dollars avatar Oct 27 '25 05:10 AC17dollars