src/solaris/classes/sun/awt/X11/XWindowPeer.java
Print this page
@@ -614,44 +614,44 @@
}
}
public void handleWindowFocusIn_Dispatch() {
if (EventQueue.isDispatchThread()) {
- XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow((Window) target);
+ XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow((Window) target);
WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_GAINED_FOCUS);
SunToolkit.setSystemGenerated(we);
target.dispatchEvent(we);
}
}
public void handleWindowFocusInSync(long serial) {
WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_GAINED_FOCUS);
- XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow((Window) target);
+ XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow((Window) target);
sendEvent(we);
}
// NOTE: This method may be called by privileged threads.
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
public void handleWindowFocusIn(long serial) {
WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_GAINED_FOCUS);
/* wrap in Sequenced, then post*/
- XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow((Window) target);
+ XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow((Window) target);
postEvent(wrapInSequenced((AWTEvent) we));
}
// NOTE: This method may be called by privileged threads.
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
public void handleWindowFocusOut(Window oppositeWindow, long serial) {
WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_LOST_FOCUS, oppositeWindow);
- XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow(null);
- XKeyboardFocusManagerPeer.setCurrentNativeFocusOwner(null);
+ XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow(null);
+ XKeyboardFocusManagerPeer.getInstance().setCurrentFocusOwner(null);
/* wrap in Sequenced, then post*/
postEvent(wrapInSequenced((AWTEvent) we));
}
public void handleWindowFocusOutSync(Window oppositeWindow, long serial) {
WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_LOST_FOCUS, oppositeWindow);
- XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow(null);
- XKeyboardFocusManagerPeer.setCurrentNativeFocusOwner(null);
+ XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow(null);
+ XKeyboardFocusManagerPeer.getInstance().setCurrentFocusOwner(null);
sendEvent(we);
}
/* --- DisplayChangedListener Stuff --- */
@@ -1135,11 +1135,11 @@
int state = getWMState();
// getWMState() always returns 0 (Withdrawn) for simple windows. Hence
// we ignore the state for such windows.
if (isVisible() && (state == XUtilConstants.NormalState || isSimpleWindow())) {
- if (XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow() ==
+ if (XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow() ==
getTarget())
{
show = true;
}
@@ -1192,11 +1192,11 @@
* When disposing an owned Window we should implicitly
* return focus to its decorated owner because it won't
* receive WM_TAKE_FOCUS.
*/
if (isSimpleWindow()) {
- if (target == XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow()) {
+ if (target == XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow()) {
Window owner = getDecoratedOwner((Window)target);
((XWindowPeer)AWTAccessor.getComponentAccessor().getPeer(owner)).requestWindowFocus();
}
}
}
@@ -1833,11 +1833,11 @@
public boolean requestWindowFocus(long time, boolean timeProvided) {
focusLog.fine("Request for window focus");
// If this is Frame or Dialog we can't assure focus request success - but we still can try
// If this is Window and its owner Frame is active we can be sure request succedded.
Window ownerWindow = XWindowPeer.getDecoratedOwner((Window)target);
- Window focusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
+ Window focusedWindow = XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow();
Window activeWindow = XWindowPeer.getDecoratedOwner(focusedWindow);
if (isWMStateNetHidden()) {
focusLog.fine("The window is unmapped, so rejecting the request");
return false;