[mutter] Use libX11's Xkb* API unconditionally



commit 6af48de0b8c1d12ee90b9b81a5065eb66f54cc08
Author: Rui Matos <tiagomatos gmail com>
Date:   Tue Aug 5 15:53:03 2014 +0200

    Use libX11's Xkb* API unconditionally
    
    At this point there shouldn't be any system capable of running mutter
    that doesn't have it and we're introducing functionality like setting
    the keymap that has an hard requirement on it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734301

 configure.ac               |   11 -----------
 src/core/bell.c            |    8 --------
 src/core/bell.h            |    4 ----
 src/core/display-private.h |    2 --
 src/core/display.c         |    2 --
 src/core/keybindings.c     |    9 +--------
 6 files changed, 1 insertions(+), 35 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 9fd3900..b5bbc2f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -235,17 +235,6 @@ if test x$have_xinerama = xno; then
    AC_MSG_ERROR([Xinerama extension was not found])
 fi
 
-found_xkb=no
-AC_CHECK_LIB(X11, XkbQueryExtension,
-               [AC_CHECK_HEADER(X11/XKBlib.h,
-                                found_xkb=yes)],
-       , $ALL_X_LIBS)
-
-if test "x$found_xkb" = "xyes"; then
-   AC_DEFINE(HAVE_XKB, , [Have keyboard extension library])
-fi
-
-
 RANDR_LIBS=
 found_randr=no
 AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
diff --git a/src/core/bell.c b/src/core/bell.c
index 8b4e76b..7c89160 100644
--- a/src/core/bell.c
+++ b/src/core/bell.c
@@ -69,7 +69,6 @@
  *
  * If the configure script found we had no XKB, this does not exist.
  */
-#ifdef HAVE_XKB
 static void
 bell_flash_fullscreen (MetaDisplay *display,
                        XkbAnyEvent *xkb_ev)
@@ -244,12 +243,10 @@ meta_bell_notify (MetaDisplay *display,
     }
 #endif /* HAVE_LIBCANBERRA */
 }
-#endif /* HAVE_XKB */
 
 void
 meta_bell_set_audible (MetaDisplay *display, gboolean audible)
 {
-#ifdef HAVE_XKB
 #ifdef HAVE_LIBCANBERRA
   /* When we are playing sounds using libcanberra support, we handle the
    * bell whether its an audible bell or a visible bell */
@@ -262,13 +259,11 @@ meta_bell_set_audible (MetaDisplay *display, gboolean audible)
                             XkbUseCoreKbd,
                             XkbAudibleBellMask,
                             enable_system_bell ? XkbAudibleBellMask : 0);
-#endif /* HAVE_XKB */
 }
 
 gboolean
 meta_bell_init (MetaDisplay *display)
 {
-#ifdef HAVE_XKB
   int xkb_base_error_type, xkb_opcode;
 
   if (!XkbQueryExtension (display->xdisplay, &xkb_opcode,
@@ -298,20 +293,17 @@ meta_bell_init (MetaDisplay *display)
       }
       return TRUE;
     }
-#endif
   return FALSE;
 }
 
 void
 meta_bell_shutdown (MetaDisplay *display)
 {
-#ifdef HAVE_XKB
   /* TODO: persist initial bell state in display, reset here */
   XkbChangeEnabledControls (display->xdisplay,
                            XkbUseCoreKbd,
                            XkbAudibleBellMask,
                            XkbAudibleBellMask);
-#endif
 }
 
 /**
diff --git a/src/core/bell.h b/src/core/bell.h
index 70bd97b..dbbafa7 100644
--- a/src/core/bell.h
+++ b/src/core/bell.h
@@ -18,13 +18,10 @@
  */
 
 #include <X11/Xlib.h>
-#ifdef HAVE_XKB
 #include <X11/XKBlib.h>
-#endif
 #include "display-private.h"
 #include "frame.h"
 
-#ifdef HAVE_XKB
 /**
  * meta_bell_notify:
  * @display: The display the bell event came in on
@@ -37,7 +34,6 @@
  * If the configure script found we had no XKB, this does not exist.
  */
 void meta_bell_notify (MetaDisplay *display, XkbAnyEvent *xkb_ev);
-#endif
 
 /**
  * meta_bell_set_audible:
diff --git a/src/core/display-private.h b/src/core/display-private.h
index 606440e..95d79e8 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -207,10 +207,8 @@ struct _MetaDisplay
    */
   int         sentinel_counter;
 
-#ifdef HAVE_XKB
   int         xkb_base_event_type;
   guint32     last_bell_time;
-#endif
   int        grab_resize_timeout_id;
 
   /* Keybindings stuff */
diff --git a/src/core/display.c b/src/core/display.c
index 77a9f5d..0b360ba 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -634,9 +634,7 @@ meta_display_open (void)
   display->grab_resize_timeout_id = 0;
   display->grab_have_keyboard = FALSE;
 
-#ifdef HAVE_XKB
   display->last_bell_time = 0;
-#endif
 
   display->grab_op = META_GRAB_OP_NONE;
   display->grab_window = NULL;
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 09d95d5..db8708f 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -51,9 +51,7 @@
 
 #include <xkbcommon/xkbcommon.h>
 
-#ifdef HAVE_XKB
 #include <X11/XKBlib.h>
-#endif
 
 #include "backends/x11/meta-backend-x11.h"
 #include "x11/window-x11.h"
@@ -930,7 +928,6 @@ meta_display_process_mapping_event (MetaDisplay *display,
   gboolean keymap_changed = FALSE;
   gboolean modmap_changed = FALSE;
 
-#ifdef HAVE_XKB
   if (event->type == display->xkb_base_event_type)
     {
       meta_topic (META_DEBUG_KEYBINDINGS,
@@ -939,9 +936,7 @@ meta_display_process_mapping_event (MetaDisplay *display,
       keymap_changed = TRUE;
       modmap_changed = TRUE;
     }
-  else
-#endif
-  if (event->xmapping.request == MappingModifier)
+  else if (event->xmapping.request == MappingModifier)
     {
       meta_topic (META_DEBUG_KEYBINDINGS,
                   "Received MappingModifier event, will reload modmap and redo keybindings\n");
@@ -3966,11 +3961,9 @@ meta_display_init_keys (MetaDisplay *display)
 
   meta_prefs_add_listener (bindings_changed_callback, display);
 
-#ifdef HAVE_XKB
   /* meta_display_init_keys() should have already called XkbQueryExtension() */
   if (display->xkb_base_event_type != -1)
     XkbSelectEvents (display->xdisplay, XkbUseCoreKbd,
                      XkbNewKeyboardNotifyMask | XkbMapNotifyMask,
                      XkbNewKeyboardNotifyMask | XkbMapNotifyMask);
-#endif
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]