changeset 7140:3a38a1ed0e23

RT-33665: [SwingNode, Linux] : combobox can not get item change events Summary: Don't delegate grab focus requests to FX on Linux
author Anthony Petrov <anthony.petrov@oracle.com>
date Tue, 27 May 2014 21:46:47 +0400
parents 05367a06c685
children 2dcb43d25d9a
files modules/swing/src/main/java/javafx/embed/swing/SwingNode.java
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/swing/src/main/java/javafx/embed/swing/SwingNode.java	Tue May 27 08:46:45 2014 -0700
+++ b/modules/swing/src/main/java/javafx/embed/swing/SwingNode.java	Tue May 27 21:46:47 2014 +0400
@@ -71,6 +71,7 @@
 import com.sun.javafx.stage.FocusUngrabEvent;
 import com.sun.javafx.stage.ScreenHelper;
 import com.sun.javafx.stage.WindowHelper;
+import com.sun.javafx.PlatformUtil;
 import sun.awt.UngrabEvent;
 import sun.awt.LightweightFrame;
 import sun.swing.JLightweightFrame;
@@ -670,6 +671,10 @@
         @Override
         public void focusGrabbed() {
             SwingFXUtils.runOnFxThread(() -> {
+                // On X11 grab is limited to a single XDisplay connection,
+                // so we can't delegate it to another GUI toolkit.
+                if (PlatformUtil.isLinux()) return;
+
                 if (getScene() != null &&
                         getScene().getWindow() != null &&
                         getScene().getWindow().impl_getPeer() != null) {
@@ -717,6 +722,10 @@
     }
 
     private void ungrabFocus(boolean postUngrabEvent) {
+        // On X11 grab is limited to a single XDisplay connection,
+        // so we can't delegate it to another GUI toolkit.
+        if (PlatformUtil.isLinux()) return;
+
         if (grabbed &&
             getScene() != null &&
             getScene().getWindow() != null &&