On Tue, 17 Nov 2026 18:59:23 GMT, Michael Strauß <[email protected]> wrote:

>> GTK's `PlatformSupport` class only listens to the `gtk-theme-name` signal to 
>> detect theme changes. However, it seems that with KDE, color changes are 
>> posted with a delay after the theme change. Since we only collect platform 
>> preferences when the theme name was changed, we can miss delayed color 
>> changes.
>> 
>> The fix is to also listen to a changed style context. The style context's 
>> `changed` signal can fire multiple times, so we don't collect the new 
>> preferences right away, but schedule them to be collected in an idle 
>> callback.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Michael Strauß has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   use GtkStyleContext instead of GtkStyle

Tested locally just now on KDE Plasma 6.8.3. Works!
I also tested changing `Colors & Theme -> Colors` and `Colors & Theme -> 
Application Style` too. Both also work as before!

One question left:

The preference listener in my reproducer will always get two changes:


--- Switch Dark -> Light
GTK.theme_name=Breeze-Dark, colorScheme=DARK, backgroundColor=0x202326ff
GTK.theme_name=Breeze-Dark, colorScheme=LIGHT, backgroundColor=0xeff0f1ff
--- Switch Light -> Dark
GTK.theme_name=Breeze, colorScheme=LIGHT, backgroundColor=0xeff0f1ff
GTK.theme_name=Breeze, colorScheme=DARK, backgroundColor=0x202326ff


Probably intended?
Shall we revisit: https://github.com/openjdk/jfx/pull/1810 at one point?

-------------

Marked as reviewed by mhanl (Reviewer).

PR Review: https://git.openjdk.org/jfx/pull/2372#pullrequestreview-5949296447

Reply via email to