changeset 13718:ac2bee64b971

8225101: Crash at sun.awt.X11.XlibWrapper.XkbGetUpdatedMap when change keybord map Reviewed-by: prr, pbansal
author serb
date Thu, 12 Sep 2019 22:20:35 -0700
parents 7bae06012fbf
children 9411ed365793
files src/solaris/classes/sun/awt/X11/XToolkit.java
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/awt/X11/XToolkit.java	Fri Jan 16 12:41:36 2015 +0100
+++ b/src/solaris/classes/sun/awt/X11/XToolkit.java	Thu Sep 12 22:20:35 2019 -0700
@@ -2415,14 +2415,16 @@
                  //System.out.println("XkbNewKeyboard:"+(xke.get_new_kbd()));
                  break;
             case XConstants.XkbMapNotify :
-                 //TODO: provide a simple unit test.
-                 XlibWrapper.XkbGetUpdatedMap(getDisplay(),
-                                              XConstants.XkbKeyTypesMask    |
-                                              XConstants.XkbKeySymsMask     |
-                                              XConstants.XkbModifierMapMask |
-                                              XConstants.XkbVirtualModsMask,
-                                              awt_XKBDescPtr);
-                 //System.out.println("XkbMap:"+(xke.get_map()));
+                 if (awt_XKBDescPtr != 0) {
+                    //TODO: provide a simple unit test.
+                    XlibWrapper.XkbGetUpdatedMap(getDisplay(),
+                                                 XConstants.XkbKeyTypesMask    |
+                                                 XConstants.XkbKeySymsMask     |
+                                                 XConstants.XkbModifierMapMask |
+                                                 XConstants.XkbVirtualModsMask,
+                                                 awt_XKBDescPtr);
+                 }
+                //System.out.println("XkbMap:"+(xke.get_map()));
                  break;
             case XConstants.XkbStateNotify :
                  // May use it later e.g. to obtain an effective group etc.