changeset 6963:585d0b241f1f

RT-36805: [Popup] Popup "steals" focus, when hiding the popup (regression) Summary: Don't call requestToFront() on the owner stage if the hiding owned stage is unfocusable Reviewed-by: kcr, snorthov
author Anthony Petrov <anthony.petrov@oracle.com>
date Thu, 08 May 2014 12:52:06 +0400
parents d4538aca965d
children 8c38297db42b
files modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java	Wed May 07 20:11:19 2014 +0300
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java	Thu May 08 12:52:06 2014 +0400
@@ -439,7 +439,9 @@
             } else {
                 // Note: This method is required to workaround a glass issue
                 // mentioned in RT-12607
-                if (owner != null && owner instanceof WindowStage) {
+                // If the hiding stage is unfocusable (i.e. it's a PopupStage),
+                // then we don't do this to avoid stealing the focus.
+                if (!isPopupStage && owner != null && owner instanceof WindowStage) {
                     WindowStage ownerStage = (WindowStage)owner;
                     ownerStage.requestToFront();
                 }