When I create a new GtkCssProvider , shouldn’t it adopt the value of the settings::gtk-interface-color-scheme property?
The end result is that @media is ignored unless I manually set the provider’s prefers-color-scheme property.
When I create a new GtkCssProvider , shouldn’t it adopt the value of the settings::gtk-interface-color-scheme property?
The end result is that @media is ignored unless I manually set the provider’s prefers-color-scheme property.
Hi,
What is the value of settings::gtk-interface-color-scheme before you manually set it?
Are you using libadwaita, of gtk alone?
GTK_INTERFACE_COLOR_SCHEME_DARK
gtk alone
Looking at gtk code, they manually bind their internal GtkCssProvider properties to GtkSettings: gtk/gtksettings.c · 4.21.1 · GNOME / gtk · GitLab
So I assume the observed behavior is correct, and you may need to do this on your provider too.
Thanks. This is the only way.
But this is very different from what I was thinking.
I believe GTK_INTERFACE_COLOR_SCHEME_DEFAULT should be synchronized with GSetings by default.
If synchronization is not desired, using default is meaningless; it should specify light or dark.
No, it should not.
Platform libraries like libadwaita and libgranite, as well as applications that provide their own platform integration, create their own GtkCssProvider to load their own style, and manage the settings according to the platform currently in use. If GtkCssProvider kept the settings in sync, things would break.
GTK can keep settings in sync for the style providers it creates, because those are not exposed.