changeset 559:97d85ec01100

6454041: decimal separator munches the character standing at the right (sk keyboard) Summary: in a group of keysyms associated with a key, check for keypad-ness of more keysyms Reviewed-by: art
author yan
date Tue, 05 Aug 2008 15:26:08 +0400
parents 250129565224
children f0043a2428f6
files src/solaris/classes/sun/awt/X11/XKeysym.java src/solaris/classes/sun/awt/X11/keysym2ucs.h
diffstat 2 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/awt/X11/XKeysym.java	Fri Jul 25 15:19:11 2008 +0400
+++ b/src/solaris/classes/sun/awt/X11/XKeysym.java	Tue Aug 05 15:26:08 2008 +0400
@@ -101,10 +101,15 @@
         // Otherwise, it is [1].
         int ndx = XToolkit.isXsunServer() &&
                   ! XToolkit.isXKBenabled() ? 2 : 1;
+        // Even if XKB is enabled, we have another problem: some symbol tables (e.g. cz) force
+        // a regular comma instead of KP_comma for a decimal separator. Result is,
+        // bugs like 6454041. So, we will try for keypadness  a keysym with ndx==0 as well.
         XToolkit.awtLock();
         try {
-            return XlibWrapper.IsKeypadKey(
-                XlibWrapper.XKeycodeToKeysym(ev.get_display(), ev.get_keycode(), ndx ) );
+            return (XlibWrapper.IsKeypadKey(
+                XlibWrapper.XKeycodeToKeysym(ev.get_display(), ev.get_keycode(), ndx ) ) ||
+                   XlibWrapper.IsKeypadKey(
+                XlibWrapper.XKeycodeToKeysym(ev.get_display(), ev.get_keycode(), 0 ) ));
         } finally {
             XToolkit.awtUnlock();
         }
--- a/src/solaris/classes/sun/awt/X11/keysym2ucs.h	Fri Jul 25 15:19:11 2008 +0400
+++ b/src/solaris/classes/sun/awt/X11/keysym2ucs.h	Tue Aug 05 15:26:08 2008 +0400
@@ -139,10 +139,15 @@
 tojava         // Otherwise, it is [1].
 tojava         int ndx = XToolkit.isXsunServer() &&
 tojava                   ! XToolkit.isXKBenabled() ? 2 : 1;
+tojava         // Even if XKB is enabled, we have another problem: some symbol tables (e.g. cz) force
+tojava         // a regular comma instead of KP_comma for a decimal separator. Result is,
+tojava         // bugs like 6454041. So, we will try for keypadness  a keysym with ndx==0 as well.
 tojava         XToolkit.awtLock();
 tojava         try {
-tojava             return XlibWrapper.IsKeypadKey(
-tojava                 XlibWrapper.XKeycodeToKeysym(ev.get_display(), ev.get_keycode(), ndx ) );
+tojava             return (XlibWrapper.IsKeypadKey(
+tojava                 XlibWrapper.XKeycodeToKeysym(ev.get_display(), ev.get_keycode(), ndx ) ) ||
+tojava                    XlibWrapper.IsKeypadKey(
+tojava                 XlibWrapper.XKeycodeToKeysym(ev.get_display(), ev.get_keycode(), 0 ) ));
 tojava         } finally {
 tojava             XToolkit.awtUnlock();
 tojava         }