src/solaris/classes/sun/awt/X11/XChoicePeer.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -1031,19 +1031,21 @@
                 return super.prePostEvent(e);
             }
             //fix 6252982: PIT: Keyboard FocusTraversal not working when choice's drop-down is visible, on XToolkit
             if (e instanceof KeyEvent){
                 // notify XWindow that this event had been already handled and no need to post it again
-                EventQueue.invokeLater(new Runnable() {
+                InvocationEvent ev = new InvocationEvent(target, new Runnable() {
                         public void run() {
                             if(target.isFocusable() &&
                                getParentTopLevel().isFocusableWindow() )
                             {
                                 handleJavaKeyEvent((KeyEvent)e);
                             }
                         }
                     });
+                postEvent(ev);
+
                 return true;
             } else {
                 if (e instanceof MouseEvent){
                     // Fix for 6240046 : REG:Choice's Drop-down does not disappear when clicking somewhere, after popup menu is disposed
                     // if user presses Right Mouse Button on opened (unfurled)

@@ -1081,15 +1083,17 @@
     }
 
     //convenient method
     //do not generate this kind of Events
     public boolean handleMouseEventByChoice(final MouseEvent me){
-        EventQueue.invokeLater(new Runnable() {
+        InvocationEvent ev = new InvocationEvent(target, new Runnable() {
                 public void run() {
                     handleJavaMouseEvent(me);
                 }
             });
+        postEvent(ev);
+
         return true;
     }
 
     /* Returns true if the MouseEvent coords
      * are inside of the Choice itself (it doesnt's depends on