Skip to content
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

Modal dialog with wrong parent can lock up the application #5987

Closed
rkeen-siemens opened this issue May 24, 2023 · 3 comments · Fixed by #5989 or #6216
Closed

Modal dialog with wrong parent can lock up the application #5987

rkeen-siemens opened this issue May 24, 2023 · 3 comments · Fixed by #5989 or #6216
Labels
kind:bug Bug report or fix

Comments

@rkeen-siemens
Copy link
Contributor

Apache NetBeans version

Apache NetBeans 17

What happened

DialogDisplayerImpl.notify sets the wrong parent when the currently active window is a modal dialog. When running with FlatLaf providing window decorations via setDefaultLookAndFeelDecorated on Linux, this allows the user to click the previously active modal dialog to bring it to the front due to JDK-8306001.

How to reproduce

Start a platform application with the following run before creating any UI (e.g. in an override of ModuleInstall.validate):

JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);

Then from within an open model dialog invoke another using DialogDisplayer.notify and click the originally open dialog. This dialog will come to the front and if the new dialog is completely hidden there is nothing the user can do but kill the application.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Linux

JDK

JDK 17

Apache NetBeans packaging

Apache NetBeans platform

Anything else

No response

Are you willing to submit a pull request?

Yes

@rkeen-siemens rkeen-siemens added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels May 24, 2023
@neilcsmith-net
Copy link
Member

Please check with NetBeans 18 - there have been some changes in this area eg. #5280 Be good to see if the issue is still relevant.

@neilcsmith-net neilcsmith-net added pending-response Awaiting further information to be supplied and removed needs:triage Requires attention from one of the committers labels May 24, 2023
@rkeen-siemens
Copy link
Contributor Author

Thanks for pointing that out @neilcsmith-net, but the change to DialogDisplayerImpl was cosmetic and the same issue persists. I'll have a pull request with a fix soon.

rkeen-siemens added a commit to rkeen-siemens/incubator-netbeans that referenced this issue May 24, 2023
rkeen-siemens added a commit to rkeen-siemens/incubator-netbeans that referenced this issue May 24, 2023
@mbien mbien linked a pull request May 24, 2023 that will close this issue
@mbien mbien removed the pending-response Awaiting further information to be supplied label May 25, 2023
@neilcsmith-net
Copy link
Member

Yes, the changes directly in DialogDisplayerImpl were cosmetic, but there were other changes recently in parenting logic that I thought might be relevant. They at least need to be consistent, and ideally in one place.

There's no need to open an issue if you have a PR ready anyway. Let's take the conversation there.

rkeen-siemens added a commit to rkeen-siemens/incubator-netbeans that referenced this issue May 25, 2023
… parent to allow parents in non-active windows as long as the active window is not modal.
rkeen-siemens added a commit to rkeen-siemens/incubator-netbeans that referenced this issue May 25, 2023
rkeen-siemens added a commit to rkeen-siemens/incubator-netbeans that referenced this issue Jun 7, 2023
rkeen-siemens added a commit to rkeen-siemens/incubator-netbeans that referenced this issue Jul 14, 2023
neilcsmith-net added a commit to neilcsmith-net/netbeans that referenced this issue Aug 3, 2023
This reverts commit d7474cf.

Revert "apache#5987: Use the currently active dialog as the presenter parent."

This reverts commit d1ac397.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Bug report or fix
Projects
None yet
3 participants