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
8284654: Modal behavior returns to wrong stage #784
Conversation
Merge master
Merge from jfx
merge from jfx
Merge upstream
Merge from upstream
Update from master
Merge from upstream
Merge with main
Merge master
Merge master
Update from jfx
Pull from origin
Merge master
|
Webrevs
|
I'll take a look at it, and also ask @arapte to review. As you know from my comment in the bug report, I especially want to ensure that this causes no regressions, so need to test JDK-8240640 on macOS. /reviewers 2 |
@kevinrushforth |
This change fixes the exact issue that is reported in JDK-8284654. But I observed another issue that occurs with this change.
I think the expected behavior here should be: After closing a dialog the Focus should return to its parent window. |
@arapte I think it's another bug on Linux, as the window should not accept focus when disabled, so it should not reorder windows when you click it ("Window One" on step 5). Did you test it on Linux? |
Step 5 falls on:
which is correct, so might be a bug on java code. |
I tested it on MacOS Catalina 10.15.7
The window does not really gets the focus. The button cannot be clicked. but it does bring the window in foreground. Yes, It may be a different bug. The similarity is that the focus does not go back to parent stage after closing the dialog. |
The test does not set the Window owner. It's one APPLICATION_MODAL window. I have adjusted the PR to handle this case. It will set focus on the latest opened window when re-enabling, but will not change stacking order. |
The original fix gets affected by the new commit.
|
This reverts commit b024de5.
I reverted the last change. After more analysis I think it's not a bug, but a side-effect of not using native window modality in favor of enabling/disabling windows. It works like this: On the original step 5 ("Click anywhere in Window One") the window would get the focus, but instead will send a FOCUS_DISABLED event, which will bring up the MODAL window. The problem is that the window will get the focus, to be lost in favor of the last window (which is the MODAL one). To prevent this, a disabled window should never be focused. But that prevents the whole FOCUS_DISABLED logic. Note that the APPLICATION_MODAL window on the example has no owner, so I think it's ok to consider a side effect and not a bug. |
The fix look good to me. |
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.
Looks good now.
@tsayao This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 30 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
|
/integrate |
Going to push as commit 864792d.
Your commit was automatically rebased without conflicts. |
When there's an APPLICATION_MODAL window, all other windows are disabled and re-enabled when the APPLICATION_MODAL window closes. This causes
requestToFront()
to be called on every window, and it does not guarantee order.The fix also works for:
https://bugs.openjdk.java.net/browse/JDK-8269429
But this one might need another fix:
https://bugs.openjdk.java.net/browse/JDK-8240640
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jfx pull/784/head:pull/784
$ git checkout pull/784
Update a local copy of the PR:
$ git checkout pull/784
$ git pull https://git.openjdk.java.net/jfx pull/784/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 784
View PR using the GUI difftool:
$ git pr show -t 784
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jfx/pull/784.diff