You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "neilcsmith-net (via GitHub)" <gi...@apache.org> on 2023/07/17 14:07:59 UTC
[GitHub] [netbeans] neilcsmith-net commented on a diff in pull request #5989: #5987: Use the currently active dialog as the presenter parent
neilcsmith-net commented on code in PR #5989:
URL: https://github.com/apache/netbeans/pull/5989#discussion_r1265423576
##########
platform/core.windows/src/org/netbeans/core/windows/services/DialogDisplayerImpl.java:
##########
@@ -95,53 +96,46 @@ public Dialog createDialog (final DialogDescriptor d, final Frame preferredParen
}
return Mutex.EVENT.readAccess (new Mutex.Action<Dialog> () {
public Dialog run () {
- // if a modal dialog active use it as parent
- // otherwise use the main window
- if (NbPresenter.currentModalDialog != null) {
- NbDialog dlg;
- if (NbPresenter.currentModalDialog.isLeaf ()) {
- dlg = new NbDialog(d, WindowManager.getDefault ().getMainWindow ());
- } else {
- dlg = new NbDialog(d, NbPresenter.currentModalDialog);
- }
- customizeDlg(dlg);
- return dlg;
- }
- else {
- Window w = preferredParent;
- if( null == w ) {
- w = KeyboardFocusManager.getCurrentKeyboardFocusManager ().getActiveWindow ();
- if (!(w instanceof NbPresenter) || !w.isVisible()) {
- // undocked window is not instanceof NbPresenter although it's NetBeans's native window
- // all docked windows implements ModeUIBase interface
- if (! (w instanceof DefaultSeparateContainer.ModeUIBase)) {
- Container cont = SwingUtilities.getAncestorOfClass(Window.class, w);
- if (cont instanceof DefaultSeparateContainer.ModeUIBase) {
- w = (Window) cont;
- } else {
- // don't set non-ide window as parent
- w = WindowManager.getDefault ().getMainWindow ();
- }
+ Window w = preferredParent;
+ if( null == w ) {
+ w = findDialogParent();
Review Comment:
Is there a bug here? The old code doesn't use `preferredParent` if there's a modal dialog. Should the preferred parent be passed through to Utilities via `findDialogParent` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists