RFR: 8296387: [Tooltip, CSS] -fx-show-delay is only applied to the first tooltip that is shown before it is displayed [v6]

Andy Goryachev angorya at openjdk.org
Tue May 28 16:56:15 UTC 2024


On Sun, 26 May 2024 13:02:23 GMT, Marius Hanl <mhanl at openjdk.org> wrote:

>> This PR fixes a long standing issue where the `Tooltip` will always wait one second until it appears the very first time, even if the 
>> `-fx-show-delay` was set to another value.
>> 
>> The culprit is, that the `cssForced` flag is not inside `Tooltip`, but inside the `TooltipBehaviour`. So the very first `Tooltip` gets processed correctly, but after no `Tooltip` will be processed by CSS before showing, resulting in the set `-fx-show-delay` to not be applied immediately.
>> 
>> Added a bunch of headful tests for the behaviour since there were none before.
>
> Marius Hanl has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add a test for changing the stylesheet and always process CSS for that matter

modules/javafx.graphics/src/main/java/javafx/stage/PopupWindow.java line 461:

> 459: 
> 460:         // RT-28447
> 461:         applyStylesheetFromOwner(owner);

minor: Does this comment RT-28477 (https://bugs.openjdk.org/browse/JDK-8116444) applies to the change of to the code that follows?

modules/javafx.graphics/src/main/java/javafx/stage/PopupWindow.java line 493:

> 491:                 scene.setUserAgentStylesheet(ownerScene.getUserAgentStylesheet());
> 492:             }
> 493:             scene.getStylesheets().setAll(ownerScene.getStylesheets());

so if the application decides to set a particular style sheet on the tooltip scene, it will be ignored?  Should it be addAll()?  And if yes, should it check against duplicate entries?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1394#discussion_r1617624406
PR Review Comment: https://git.openjdk.org/jfx/pull/1394#discussion_r1617620949


More information about the openjfx-dev mailing list