-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8296387: [Tooltip, CSS] -fx-show-delay is only applied to the first tooltip that is shown before it is displayed #1394
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back mhanl! A progress list of the required criteria for merging this PR into |
Webrevs
|
6d40b52
to
f0c5224
Compare
@Maran23 Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
f0c5224
to
cd9892b
Compare
@Maran23 Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
…st tooltip that is shown before it is displayed
cd9892b
to
a4a1a49
Compare
@Maran23 Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
Testing the combined (this PR merged with the latest master) on macOS 14.3.1 M1 Pro (though this is probably not important), using the latest MonkeyTester
What I see is the very first time the tooltip appears it's using the old show-delay value of 1000ms. Any subsequent attempts the new delay is in effect. Then, change back to 1000ms. Same thing happens: the first time the old timeout value is used instead of the new. |
There is also another problem (though it is a separate issue as it can be seen with the master branch):
Notice how sometimes, when slowly entering the tooltip page from the left side, the tooltip appears and then disappears. Async code is hard! edit 2024/04/12: created https://bugs.openjdk.org/browse/JDK-8330187 |
the disappearing tooltip clip (will move to its own ticket later): video1956899183.mp4 |
This is another, unrelated issue: If I specify a number instead of duration like
Once that happens, the exception will get thrown every time, even after the correct CSS is entered. The app must be restarted. But we don't get an exception for a boolean value:
edit 2024/11/12: created https://bugs.openjdk.org/browse/JDK-8330186 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although the change is an improvement, I think a similar problem will still be present when CSS changes. The cssForced
flag I think needs to reset to false
whenever a CSS styleable property of the tool tip is modified. That would include all such properties...
This is a bit of a general issue in JavaFX (it really shouldn't be possible for any Node
to be shown that hasn't had CSS processed for it), yet this can easily happen, and depending on how different the default style is versus the intended style, this can lead to a visual artifact (most noticable is for example a white background, when it is supposed to be black or transparent).
Perhaps we should open an issue to solve this for all controls in one go? A solution that would prevent any Node
from being displayed without CSS applied?
There seems to be a difference when using |
Yes, that sounds like a good idea. Checking the calls to
Will check. |
…tylesheets are considered for the e.g. tooltip show-delay
modules/javafx.controls/src/main/java/javafx/scene/control/Tooltip.java
Outdated
Show resolved
Hide resolved
This is because the CSS implementation thinks it is a PX value and therefore parse it wrong. You can check the CssParser to see why this happens. Fix might be simple, but the code in the parser is very error prone for this kind of stuff. (And Note that the StyleableProperty does not do any typecheck, therefore a double value can be set where a Duration would be expected, which is very very bad) |
❗ This change is not yet ready to be integrated. |
@Maran23 This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
keep it open. |
Please sync up with the latest master (should be a SOP for any long outstanding PRs - sorry for long delay!)
^ please remove the 'stage' argument, see JDK-8325566 |
modules/javafx.controls/src/main/java/javafx/scene/control/Tooltip.java
Outdated
Show resolved
Hide resolved
@Maran23 This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
…orrect CSS processing for the Tooltip Node.
Strange: I still see the same issue described in |
I don't know what is happening there, are you sure that there isn't a problem on your side? Testing |
I am not sure what the difference might be. The code in the MonkeyTester generates a stylesheet, encodes it in base64 data url and adds it to all scenes in the application (it also removes the old version, if any). The stylesheet gets loaded - I can see it by slightly changed colors and the fact that the tooltip show delay gets changed on the second and any subsequent invocations. Can you try it? |
with the latest monkey tester I see that updating the stylesheet does not update the showingDelay property immediately. When the tooltip gets shown, I see the following output from the change listener added to this property:
I suppose the second setting of 100ms (the value I actually set) happens too late or simply is ignored. |
Ah, I think I know why. Same problem, we copy the stylesheet right before showing, so this is updated to late once again. We may need to do the update stuff always before showing. |
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 insideTooltip
, but inside theTooltipBehaviour
. So the very firstTooltip
gets processed correctly, but after noTooltip
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.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1394/head:pull/1394
$ git checkout pull/1394
Update a local copy of the PR:
$ git checkout pull/1394
$ git pull https://git.openjdk.org/jfx.git pull/1394/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1394
View PR using the GUI difftool:
$ git pr show -t 1394
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1394.diff
Webrev
Link to Webrev Comment