You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2023/01/18 18:10:07 UTC

[GitHub] [netbeans] neilcsmith-net commented on a diff in pull request #5280: Improve Dialog Placement

neilcsmith-net commented on code in PR #5280:
URL: https://github.com/apache/netbeans/pull/5280#discussion_r1073899226


##########
platform/openide.util.ui/src/org/openide/util/Utilities.java:
##########
@@ -1345,8 +1362,8 @@ public static Component findDialogParent() {
             parent = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
         }
         if (parent == null) {
-            Frame[] f = Frame.getFrames();
-            parent = f.length == 0 ? null : f[f.length - 1];
+            // PR#5280
+            parent = findMainWindow();

Review Comment:
   @errael I would possibly fall back to the original behaviour if the search for the main window returns null.  Ideally it wouldn't use the name to find the right window, but that might be the easiest way to achieve.  I have no idea how many people (if any!) use `FileChoooserBuilder` outside of the standard window system, but this will change the behaviour of those cases.



-- 
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