8205479: OS X: requestFocus() does not work properly for embedded frame
Reviewed-by: serb, aivanov
This commit is contained in:
parent
299f32d852
commit
ca5903367f
@ -165,8 +165,6 @@ public class CEmbeddedFrame extends EmbeddedFrame {
|
||||
: this;
|
||||
}
|
||||
}
|
||||
// ignore focus "lost" native request as it may mistakenly
|
||||
// deactivate active window (see 8001161)
|
||||
if (globalFocusedWindow == this) {
|
||||
responder.handleWindowFocusEvent(parentWindowActive, null);
|
||||
}
|
||||
@ -181,4 +179,19 @@ public class CEmbeddedFrame extends EmbeddedFrame {
|
||||
// another window.
|
||||
return globalFocusedWindow != null ? !globalFocusedWindow.isParentWindowActive() : true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void synthesizeWindowActivation(boolean doActivate) {
|
||||
if (isParentWindowActive() != doActivate) {
|
||||
handleWindowFocusEvent(doActivate);
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateGlobalFocusedWindow(CEmbeddedFrame newGlobalFocusedWindow) {
|
||||
synchronized (classLock) {
|
||||
if (newGlobalFocusedWindow.isParentWindowActive()) {
|
||||
globalFocusedWindow = newGlobalFocusedWindow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -147,6 +147,8 @@ public class CPlatformEmbeddedFrame implements PlatformWindow {
|
||||
|
||||
@Override
|
||||
public boolean requestWindowFocus() {
|
||||
CEmbeddedFrame.updateGlobalFocusedWindow(target);
|
||||
target.synthesizeWindowActivation(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user