summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-10-24 14:01:20 +0200
committerinfirit <[email protected]>2014-10-24 15:40:43 +0200
commit897be1b007ea4789a88716d5889e5b9f8c88fbf7 (patch)
tree7131fefaa2e0c3540a312ddb9e3f08e296c5ce92 /src
parent1e7c923638600f865601bda3e2f294cadea7a244 (diff)
downloadmarco-897be1b007ea4789a88716d5889e5b9f8c88fbf7.tar.bz2
marco-897be1b007ea4789a88716d5889e5b9f8c88fbf7.tar.xz
Properly ifdef some KXB code.
Taken out of metacity commit: 238e83a98cf014c9b1082d21541e63f102d441d6 From: Alberts Muktupāvels <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/core/display.c16
-rw-r--r--src/core/keybindings.c5
2 files changed, 11 insertions, 10 deletions
diff --git a/src/core/display.c b/src/core/display.c
index a7e4f880..f569c461 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -2836,15 +2836,13 @@ static char*
key_event_description (Display *xdisplay,
XEvent *event)
{
- KeySym keysym;
- const char *str;
-
- keysym = XKeycodeToKeysym (xdisplay, event->xkey.keycode, 0);
-
- str = XKeysymToString (keysym);
-
- return g_strdup_printf ("Key '%s' state 0x%x",
- str ? str : "none", event->xkey.state);
+#ifdef HAVE_XKB
+ KeySym keysym = XkbKeycodeToKeysym(xdisplay, event->xkey.keycode, 0, 0);
+ const char *str = XKeysymToString (keysym);
+ return g_strdup_printf ("Key '%s' state 0x%x", str ? str : "none", event->xkey.state);
+#else
+ return "none";
+#endif
}
#endif /* WITH_VERBOSE_MODE */
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 9ddaf885..e0b2a7aa 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -1273,9 +1273,12 @@ meta_display_process_key_event (MetaDisplay *display,
/* window may be NULL */
+#ifdef HAVE_XKB
keysym = XKeycodeToKeysym (display->xdisplay, event->xkey.keycode, 0);
-
str = XKeysymToString (keysym);
+#else
+ str = NULL;
+#endif
/* was topic */
meta_topic (META_DEBUG_KEYBINDINGS,