changeset 35191:3de883052d49

(Fx_backspace_delete_keys_p): Use XkbGetMap and XkbGetNames instead of XkbGetKeyboard.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 10 Jan 2001 12:17:49 +0000
parents b8bdb63c0f6e
children b4a8fdcf76cf
files src/xfns.c
diffstat 1 files changed, 29 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Wed Jan 10 11:54:41 2001 +0000
+++ b/src/xfns.c	Wed Jan 10 12:17:49 2001 +0000
@@ -11179,34 +11179,45 @@
   major = XkbMajorVersion;
   minor = XkbMinorVersion;
   if (!XkbLibraryVersion (&major, &minor))
-    return Qnil;
+    {
+      UNBLOCK_INPUT;
+      return Qnil;
+    }
 
   /* Check that the server supports XKB.  */
   major = XkbMajorVersion;
   minor = XkbMinorVersion;
   if (!XkbQueryExtension (dpy, &op, &event, &error, &major, &minor))
-    return Qnil;
+    {
+      UNBLOCK_INPUT;
+      return Qnil;
+    }
   
   have_keys = Qnil;
-  kb = XkbGetKeyboard (dpy, XkbAllComponentsMask, XkbUseCoreKbd);
+  kb = XkbGetMap (dpy, XkbAllMapComponentsMask, XkbUseCoreKbd);
   if (kb)
     {
       int delete_keycode = 0, backspace_keycode = 0, i;
-      
-      for (i = kb->min_key_code;
-	   (i < kb->max_key_code
-	    && (delete_keycode == 0 || backspace_keycode == 0));
-	   ++i)
-	{
-	  /* The XKB symbolic key names can be seen most easily
-	     in the PS file generated by `xkbprint -label name $DISPLAY'.  */
-	  if (bcmp ("DELE", kb->names->keys[i].name, 4) == 0)
-	    delete_keycode = i;
-	  else if (bcmp ("BKSP", kb->names->keys[i].name, 4) == 0)
-	    backspace_keycode = i;
-	}
-
-      XkbFreeKeyboard (kb, 0, True);
+
+      if (XkbGetNames (dpy, XkbAllNamesMask, kb) == Success)
+	{
+	  for (i = kb->min_key_code;
+	       (i < kb->max_key_code
+		&& (delete_keycode == 0 || backspace_keycode == 0));
+	       ++i)
+	    {
+	      /* The XKB symbolic key names can be seen most easily
+		 in the PS file generated by `xkbprint -label name $DISPLAY'.  */
+	      if (bcmp ("DELE", kb->names->keys[i].name, 4) == 0)
+		delete_keycode = i;
+	      else if (bcmp ("BKSP", kb->names->keys[i].name, 4) == 0)
+		backspace_keycode = i;
+	    }
+
+	  XkbFreeNames (kb, 0, True);
+	}
+
+      XkbFreeClientMap (kb, 0, True);
   
       if (delete_keycode
 	  && backspace_keycode