From 261f1f0f576f19530f606650c435e49d0a748665 Mon Sep 17 00:00:00 2001 From: serb Date: Thu, 12 Sep 2019 22:20:35 -0700 Subject: [PATCH] 8225101: Crash at sun.awt.X11.XlibWrapper.XkbGetUpdatedMap when change keybord map Reviewed-by: prr, pbansal --- src/solaris/classes/sun/awt/X11/XToolkit.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/solaris/classes/sun/awt/X11/XToolkit.java b/src/solaris/classes/sun/awt/X11/XToolkit.java index 03b852cf5..0c99c9fa3 100644 --- a/src/solaris/classes/sun/awt/X11/XToolkit.java +++ b/src/solaris/classes/sun/awt/X11/XToolkit.java @@ -2415,14 +2415,16 @@ public final class XToolkit extends UNIXToolkit implements Runnable { //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. -- GitLab