void handleJavaMouseEvent(MouseEvent e) {
switch (e.getID()) {
case MouseEvent.MOUSE_PRESSED:
if (target == e.getSource() &&
!target.isFocusOwner() &&
XKeyboardFocusManagerPeer.shouldFocusOnClick(target))
{
XWindowPeer parentXWindow = getParentTopLevel();
Window parentWindow = ((Window)parentXWindow.getTarget());
// Simple windows are non-focusable in X terms but focusable in Java terms.
// As X-non-focusable they don't receive any focus events - we should generate them
// by ourselfves.
// if (parentXWindow.isFocusableWindow() /*&& parentXWindow.isSimpleWindow()*/ &&
// !(getCurrentNativeFocusedWindow() == parentWindow))
// {
// setCurrentNativeFocusedWindow(parentWindow);
// WindowEvent wfg = new WindowEvent(parentWindow, WindowEvent.WINDOW_GAINED_FOCUS);
// parentWindow.dispatchEvent(wfg);
// }
XKeyboardFocusManagerPeer.requestFocusFor(target, FocusEvent.Cause.MOUSE_EVENT);
}
break;
}
}
XComponentPeer.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:openjdk-jdk10
作者:
评论列表
文章目录