Platform preferences changes are not properly registered on Linux

Christopher Schnick crschnick at xpipe.io
Fri Feb 28 20:10:59 UTC 2025


Alright, so that seems to be more of a niche issue then. Especially with 
the display manager change to sddm. GTK is weird sometimes. On these 
systems, I will just implement a workaround to also listen to the 
GTK.theme_name and detect if it contains -dark. Not perfect, but works 
for some cases.

To test this further, I also set up a VM with Fedora Workstation 41, 
brand-new with no other DE other than Gnome 47.4 installed. The only 
thing I did on that system was upgrade all packages after install. And 
on that system, the platform preferences don't work at all. All values 
are the default values and no updates are registered for any changes. 
Perhaps that can be reproduced more easily. If that is also not 
reproducible, we can look if there is any way I can provide some 
information / test some things to troubleshoot this on that system.

On 28/02/2025 15:23, Michael Strauß wrote:
> The way we’ve implemented this is that we always query all named 
> colors, regardless of what change notification we receive. So even if 
> a color theme change wouldn’t trigger a notification, a subsequent 
> accent color change (that you observe) should pick up the changed 
> fg/bg colors.
>
> Sounds like an issue with GTK or the underlying shell bindings. One 
> way to test this hypothesis could be to write a simple GTK program 
> that exercises the gtk_style_lookup_color API after a theme change.
>
>
> Christopher Schnick <crschnick at xpipe.io> schrieb am Fr. 28. Feb. 2025 
> um 21:01:
>
>     The only change that is registered when I switch between dark mode
>     settings is:
>     replaced Yaru by Yaru-dark at key GTK.theme_name
>
>     If I change the accent color, it registers the following changes:
>     replaced 0xe95420ff by 0x03875bff at key
>     GTK.theme_unfocused_selected_bg_color
>     replaced 0xe95420ff by 0x03875bff at key GTK.theme_selected_bg_color
>     replaced Yaru by Yaru-viridian at key GTK.theme_name
>
>     It seems like this is very much limited to the foreground and
>     background
>     colors not updating. The fg and bg color is also not updating when
>     restarting the application or even rebooting. I switched to light
>     mode,
>     rebooted, and it still reports dark mode.
>
>     On 28/02/2025 14:49, Michael Strauß wrote:
>     > Are colors reported at all in the change notification on your
>     system?
>     > If not, then it's probably because gtk_style_lookup_color()
>     returns false.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20250228/fb434de9/attachment-0001.htm>


More information about the openjfx-dev mailing list