提交 90585e04 编写于 作者: A ant

6613426: two WM_TAKE_FOCUS messages on one mouse click in GNOME Metacity 2.16.0

Summary: A workaround to the metacity issue 485016.
Reviewed-by: son
上级 523d54f4
...@@ -1013,6 +1013,16 @@ abstract class XDecoratedPeer extends XWindowPeer { ...@@ -1013,6 +1013,16 @@ abstract class XDecoratedPeer extends XWindowPeer {
private void handleWmTakeFocus(XClientMessageEvent cl) { private void handleWmTakeFocus(XClientMessageEvent cl) {
focusLog.log(Level.FINE, "WM_TAKE_FOCUS on {0}", new Object[]{this}); focusLog.log(Level.FINE, "WM_TAKE_FOCUS on {0}", new Object[]{this});
// A workaround to Metacity issue (see 6613426).
// The first check is to skip redundant WM_TAKE_FOCUS on click
// in a focused frame. The second check is to allow requesting focus
// on click in a frame when its owned window is currently focused.
if (this == getNativeFocusedWindowPeer() &&
target == XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow())
{
focusLog.fine("The window is already focused, skipping.");
return;
}
requestWindowFocus(cl.get_data(1), true); requestWindowFocus(cl.get_data(1), true);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册