[Spice-devel] [PATCH] Replace HAVE_X11_XKBLIB_H with GDK_WINDOWING_X11
Daniel Albers
daniel at lbe.rs
Thu Jul 6 15:35:20 UTC 2017
Not all systems with an XKBlib.h also have a GDK with X11 support. macOS can
e.g. have HAVE_X11_XKBLIB_H without GDK_WINDOWING_X11, but GDK_WINDOWING_QUARTZ
instead.
---
Alternatively HAVE_GDK_GDK_X could be checked, but spice-gtk already depends on
GDK_WINDOWING_X11 in other places.
src/spice-gtk-session.c | 8 ++------
src/spice-widget.c | 4 ----
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
index 27623f0..1398758 100644
--- a/src/spice-gtk-session.c
+++ b/src/spice-gtk-session.c
@@ -19,10 +19,6 @@
#include <glib.h>
-#ifdef HAVE_X11_XKBLIB_H
-#include <X11/XKBlib.h>
-#include <gdk/gdkx.h>
-#endif
#ifdef GDK_WINDOWING_X11
#include <X11/Xlib.h>
#include <gdk/gdkx.h>
@@ -138,7 +134,7 @@ static guint32 get_keyboard_lock_modifiers(void)
modifiers |= SPICE_INPUTS_SCROLL_LOCK;
}
#else
-#ifdef HAVE_X11_XKBLIB_H
+#ifdef GDK_WINDOWING_X11
Display *x_display = NULL;
XKeyboardState keyboard_state;
@@ -172,7 +168,7 @@ static guint32 get_keyboard_lock_modifiers(void)
}
#else
g_warning("get_keyboard_lock_modifiers not implemented");
-#endif // HAVE_X11_XKBLIB_H
+#endif // GDK_WINDOWING_X11
#endif // GTK_CHECK_VERSION(3,18,0)
return modifiers;
}
diff --git a/src/spice-widget.c b/src/spice-widget.c
index b458909..ffd4286 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -20,10 +20,6 @@
#include <math.h>
#include <glib.h>
-#ifdef HAVE_X11_XKBLIB_H
-#include <X11/XKBlib.h>
-#include <gdk/gdkx.h>
-#endif
#ifdef GDK_WINDOWING_X11
#include <X11/Xlib.h>
#include <gdk/gdkx.h>
--
2.11.0
More information about the Spice-devel
mailing list