On Thu, 28 May 2026 14:55:34 GMT, Michael Strauß <[email protected]> wrote:

>> Several JavaFX controls use animations to convey state changes, some of 
>> which are controllable by developers (for example: `TitledPane.animated` or 
>> `Chart.animated`). However, none of those controls respect the 
>> `reducedMotion` preference that was introduced with 
>> [JDK-8341514](https://bugs.openjdk.org/browse/JDK-8341514).
>> 
>> This enhancement changes the behavior of the following control skins to take 
>> the `Scene.Preferences.reducedMotion` preference into account when 
>> determining whether to animate a state change:
>> 
>> * `TableRowSkinBase`
>> * `TitledPaneSkin`
>> * `TabPaneSkin`
>> * `PaginationSkin`
>> * Charts
>> 
>> ---------
>> - [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:
> 
>   stale animation hardening

It seems to work, the issue that I have with the implementation is a different 
kind.  Let me explain: I use 'reduce motion' setting to limit the amount of 
animation in the _OS widgets_.  I was **not** expecting to see the animation 
disabled when the `animated` flag on the chart is set to `true`.

The original rationale behind disabling animation in charts was to  "save CPU 
cycles" and it sort of makes sense.  Still questionable (because the earlier 
discussion about whether 'embedded' in this context should be 'low power' 
instead).  If the idea is to conserve power, then yes, the animation should be 
disabled.

On a desktop, however, the new behavior does not seem right.  If the chart is 
animated via property, the animation must run.

Perhaps what we should do is to control the default value of the animated 
property(ies) instead.  So if the application does not explicitly set the 
`animated` property, then it follows the platform, otherwise the 
application-set value is used.

Furthermore, perhaps there should be another platform preference property like 
`low power` which **will** disable animations when active.  For example, this 
property will kick in when the battery drops below 10% or whatever.

What do you think?

modules/javafx.controls/src/main/java/javafx/scene/control/skin/TitledPaneSkin.java
 line 199:

> 197:         super.dispose();
> 198: 
> 199:         if (timeline != null) {

isn't this just `cancelTransitionAnimation()` ?

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

PR Review: https://git.openjdk.org/jfx/pull/2177#pullrequestreview-4412733248
PR Review Comment: https://git.openjdk.org/jfx/pull/2177#discussion_r3343673073

Reply via email to