src/java.desktop/unix/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java

Print this page




  53         }
  54     }
  55 
  56     @Override
  57     public Component getCurrentFocusOwner() {
  58         synchronized(this) {
  59             return currentFocusOwner;
  60         }
  61     }
  62 
  63     @Override
  64     public void setCurrentFocusedWindow(Window win) {
  65         if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
  66             focusLog.finer("Setting current focused window " + win);
  67         }
  68 
  69         XWindowPeer from = null, to = null;
  70 
  71         synchronized(this) {
  72             if (currentFocusedWindow != null) {
  73                 from = (XWindowPeer)AWTAccessor.getComponentAccessor().getPeer(currentFocusedWindow);
  74             }
  75 
  76             currentFocusedWindow = win;
  77 
  78             if (currentFocusedWindow != null) {
  79                 to = (XWindowPeer)AWTAccessor.getComponentAccessor().getPeer(currentFocusedWindow);
  80             }
  81         }
  82 
  83         if (from != null) {
  84             from.updateSecurityWarningVisibility();
  85         }
  86         if (to != null) {
  87             to.updateSecurityWarningVisibility();
  88         }
  89     }
  90 
  91     @Override
  92     public Window getCurrentFocusedWindow() {
  93         synchronized(this) {
  94             return currentFocusedWindow;
  95         }
  96     }
  97 
  98     // TODO: do something to eliminate this forwarding
  99     public static boolean deliverFocus(Component lightweightChild,


  53         }
  54     }
  55 
  56     @Override
  57     public Component getCurrentFocusOwner() {
  58         synchronized(this) {
  59             return currentFocusOwner;
  60         }
  61     }
  62 
  63     @Override
  64     public void setCurrentFocusedWindow(Window win) {
  65         if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
  66             focusLog.finer("Setting current focused window " + win);
  67         }
  68 
  69         XWindowPeer from = null, to = null;
  70 
  71         synchronized(this) {
  72             if (currentFocusedWindow != null) {
  73                 from = AWTAccessor.getComponentAccessor().getPeer(currentFocusedWindow);
  74             }
  75 
  76             currentFocusedWindow = win;
  77 
  78             if (currentFocusedWindow != null) {
  79                 to = AWTAccessor.getComponentAccessor().getPeer(currentFocusedWindow);
  80             }
  81         }
  82 
  83         if (from != null) {
  84             from.updateSecurityWarningVisibility();
  85         }
  86         if (to != null) {
  87             to.updateSecurityWarningVisibility();
  88         }
  89     }
  90 
  91     @Override
  92     public Window getCurrentFocusedWindow() {
  93         synchronized(this) {
  94             return currentFocusedWindow;
  95         }
  96     }
  97 
  98     // TODO: do something to eliminate this forwarding
  99     public static boolean deliverFocus(Component lightweightChild,