From c0fafdbf5f383aaa4d18aaebd8b2da0ef0d7ff3e Mon Sep 17 00:00:00 2001 From: serb Date: Mon, 23 Sep 2013 21:24:34 +0400 Subject: [PATCH] 8019282: keyRelesed is reached even though key was NOT released Reviewed-by: serb, anthony Contributed-by: alexander.zvegintsev@oracle.com --- make/sun/xawt/mapfile-vers | 1 + makefiles/mapfiles/libawt_xawt/mapfile-vers | 1 + src/solaris/classes/sun/awt/X11/XToolkit.java | 2 ++ src/solaris/classes/sun/awt/X11/XlibWrapper.java | 1 + src/solaris/native/sun/xawt/XlibWrapper.c | 8 ++++++-- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/make/sun/xawt/mapfile-vers b/make/sun/xawt/mapfile-vers index 5455530cb..e75f0c191 100644 --- a/make/sun/xawt/mapfile-vers +++ b/make/sun/xawt/mapfile-vers @@ -305,6 +305,7 @@ SUNWprivate_1.1 { Java_sun_awt_X11_XlibWrapper_XkbGetUpdatedMap; Java_sun_awt_X11_XlibWrapper_XkbFreeKeyboard; Java_sun_awt_X11_XlibWrapper_XkbTranslateKeyCode; + Java_sun_awt_X11_XlibWrapper_XkbSetDetectableAutoRepeat; Java_sun_awt_X11_XlibWrapper_XGetModifierMapping; Java_sun_awt_X11_XlibWrapper_XFreeModifiermap; Java_sun_awt_X11_XlibWrapper_XRefreshKeyboardMapping; diff --git a/makefiles/mapfiles/libawt_xawt/mapfile-vers b/makefiles/mapfiles/libawt_xawt/mapfile-vers index 7a1a8117a..a2bb9bda9 100644 --- a/makefiles/mapfiles/libawt_xawt/mapfile-vers +++ b/makefiles/mapfiles/libawt_xawt/mapfile-vers @@ -305,6 +305,7 @@ SUNWprivate_1.1 { Java_sun_awt_X11_XlibWrapper_XkbGetUpdatedMap; Java_sun_awt_X11_XlibWrapper_XkbFreeKeyboard; Java_sun_awt_X11_XlibWrapper_XkbTranslateKeyCode; + Java_sun_awt_X11_XlibWrapper_XkbSetDetectableAutoRepeat; Java_sun_awt_X11_XlibWrapper_XGetModifierMapping; Java_sun_awt_X11_XlibWrapper_XFreeModifiermap; Java_sun_awt_X11_XlibWrapper_XRefreshKeyboardMapping; diff --git a/src/solaris/classes/sun/awt/X11/XToolkit.java b/src/solaris/classes/sun/awt/X11/XToolkit.java index 9b4daa1ce..7fa438f44 100644 --- a/src/solaris/classes/sun/awt/X11/XToolkit.java +++ b/src/solaris/classes/sun/awt/X11/XToolkit.java @@ -2249,6 +2249,8 @@ public final class XToolkit extends UNIXToolkit implements Runnable { XConstants.XkbModifierMapMask | XConstants.XkbVirtualModsMask, XConstants.XkbUseCoreKbd); + + XlibWrapper.XkbSetDetectableAutoRepeat(getDisplay(), true); } } } diff --git a/src/solaris/classes/sun/awt/X11/XlibWrapper.java b/src/solaris/classes/sun/awt/X11/XlibWrapper.java index 2d8fc851d..02a7c4b2a 100644 --- a/src/solaris/classes/sun/awt/X11/XlibWrapper.java +++ b/src/solaris/classes/sun/awt/X11/XlibWrapper.java @@ -509,6 +509,7 @@ static native String XSetLocaleModifiers(String modifier_list); static native long XkbGetUpdatedMap(long display, long which, long xkb); static native void XkbFreeKeyboard(long xkb, long which, boolean free_all); static native boolean XkbTranslateKeyCode(long xkb, int keycode, long mods, long mods_rtrn, long keysym_rtrn); + static native void XkbSetDetectableAutoRepeat(long display, boolean detectable); static native void XConvertCase(long keysym, diff --git a/src/solaris/native/sun/xawt/XlibWrapper.c b/src/solaris/native/sun/xawt/XlibWrapper.c index da3287193..3e75f291c 100644 --- a/src/solaris/native/sun/xawt/XlibWrapper.c +++ b/src/solaris/native/sun/xawt/XlibWrapper.c @@ -523,8 +523,12 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XlibWrapper_XkbTranslateKeyCode //printf("native, output: keysym:0x%0X; mods:0x%0X\n", *(unsigned int *)jlong_to_ptr(keysym_rtrn), *(unsigned int *)jlong_to_ptr(mods_rtrn)); return b; } - - +JNIEXPORT void JNICALL Java_sun_awt_X11_XlibWrapper_XkbSetDetectableAutoRepeat +(JNIEnv *env, jclass clazz, jlong display, jboolean detectable) +{ + AWT_CHECK_HAVE_LOCK(); + XkbSetDetectableAutoRepeat((Display *) jlong_to_ptr(display), detectable, NULL); +} /* * Class: sun_awt_X11_XlibWrapper * Method: XNextEvent -- GitLab