equal
deleted
inserted
replaced
34 import java.awt.peer.ComponentPeer; |
34 import java.awt.peer.ComponentPeer; |
35 |
35 |
36 import java.lang.reflect.InvocationTargetException; |
36 import java.lang.reflect.InvocationTargetException; |
37 import java.lang.reflect.Method; |
37 import java.lang.reflect.Method; |
38 |
38 |
39 import java.util.logging.Level; |
39 import sun.util.logging.PlatformLogger; |
40 import java.util.logging.Logger; |
|
41 |
40 |
42 import sun.awt.CausedFocusEvent; |
41 import sun.awt.CausedFocusEvent; |
43 import sun.awt.SunToolkit; |
42 import sun.awt.SunToolkit; |
44 import sun.awt.KeyboardFocusManagerPeerImpl; |
43 import sun.awt.KeyboardFocusManagerPeerImpl; |
45 |
44 |
46 public class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl { |
45 public class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl { |
47 private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XKeyboardFocusManagerPeer"); |
46 private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XKeyboardFocusManagerPeer"); |
48 |
47 |
49 private static Object lock = new Object() {}; |
48 private static Object lock = new Object() {}; |
50 private static Component currentFocusOwner; |
49 private static Component currentFocusOwner; |
51 private static Window currentFocusedWindow; |
50 private static Window currentFocusedWindow; |
52 |
51 |
80 return currentFocusOwner; |
79 return currentFocusOwner; |
81 } |
80 } |
82 } |
81 } |
83 |
82 |
84 public static void setCurrentNativeFocusedWindow(Window win) { |
83 public static void setCurrentNativeFocusedWindow(Window win) { |
85 if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Setting current native focused window " + win); |
84 if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer("Setting current native focused window " + win); |
86 XWindowPeer from = null, to = null; |
85 XWindowPeer from = null, to = null; |
87 |
86 |
88 synchronized(lock) { |
87 synchronized(lock) { |
89 if (currentFocusedWindow != null) { |
88 if (currentFocusedWindow != null) { |
90 from = (XWindowPeer)currentFocusedWindow.getPeer(); |
89 from = (XWindowPeer)currentFocusedWindow.getPeer(); |