[Spice-devel] [PATCH] Replace HAVE_X11_XKBLIB_H with GDK_WINDOWING_X11

Daniel Albers daniel at lbe.rs
Thu Jul 6 16:42:40 UTC 2017


Thanks, Pavel.
I thought I had checked this against git master, but I missed entirely 
that https://github.com/SPICE/spice-gtk is actually stale since Apr '16.

Cheers, Daniel


On 2017-07-06 18:17, Pavel Grunt wrote:
> Hi Daniel,
> 
> it's been already fixed in the spice-gtk git master:
> https://cgit.freedesktop.org/spice/spice-gtk/commit/?id=a7381b0864b7e6b15e6d08f6
> 8e53bf3a429ab4ed
> 
> Any feedback regarding issues on non X11 system is welcome.
> 
> Thanks,
> Pavel
> 
> On Thu, 2017-07-06 at 17:35 +0200, Daniel Albers wrote:
>> 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>



More information about the Spice-devel mailing list