Re: [PATCH weston] clients: Make XKB compose support conditional

2016-10-24 Thread Daniel Stone
On 23 October 2016 at 18:42, Bryce Harrington  wrote:
> On Sat, Oct 22, 2016 at 03:09:24PM +0100, Daniel Stone wrote:
>> Debian Jessie's version of libxkbcommon is too old for compose support,
>> so rather than force people to upgrade, let's make it conditional.
>>
>> Signed-off-by: Daniel Stone 
>> Cc: Bryce Harrington 
>
> Reviewed-by: Bryce Harrington 

Pushed, thanks both for reviews!

To ssh://git.freedesktop.org/git/wayland/weston
   75b7197..5b01596  push -> master

Cheers,
Daniel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] clients: Make XKB compose support conditional

2016-10-23 Thread Bryce Harrington
On Sat, Oct 22, 2016 at 03:09:24PM +0100, Daniel Stone wrote:
> Debian Jessie's version of libxkbcommon is too old for compose support,
> so rather than force people to upgrade, let's make it conditional.
> 
> Signed-off-by: Daniel Stone 
> Cc: Bryce Harrington 

Reviewed-by: Bryce Harrington 

> ---
>  clients/window.c | 12 
>  configure.ac |  4 
>  2 files changed, 16 insertions(+)
> 
> diff --git a/clients/window.c b/clients/window.c
> index 5e41210..84d585e 100644
> --- a/clients/window.c
> +++ b/clients/window.c
> @@ -63,7 +63,9 @@ typedef void *EGLContext;
>  #endif /* no HAVE_CAIRO_EGL */
>  
>  #include 
> +#ifdef HAVE_XKBCOMMON_COMPOSE
>  #include 
> +#endif
>  #include 
>  
>  #include 
> @@ -373,8 +375,10 @@ struct input {
>   struct {
>   struct xkb_keymap *keymap;
>   struct xkb_state *state;
> +#ifdef HAVE_XKBCOMMON_COMPOSE
>   struct xkb_compose_table *compose_table;
>   struct xkb_compose_state *compose_state;
> +#endif
>   xkb_mod_mask_t control_mask;
>   xkb_mod_mask_t alt_mask;
>   xkb_mod_mask_t shift_mask;
> @@ -2982,8 +2986,10 @@ keyboard_handle_keymap(void *data, struct wl_keyboard 
> *keyboard,
>   struct input *input = data;
>   struct xkb_keymap *keymap;
>   struct xkb_state *state;
> +#ifdef HAVE_XKBCOMMON_COMPOSE
>   struct xkb_compose_table *compose_table;
>   struct xkb_compose_state *compose_state;
> +#endif
>   char *locale;
>   char *map_str;
>  
> @@ -3031,6 +3037,7 @@ keyboard_handle_keymap(void *data, struct wl_keyboard 
> *keyboard,
>   locale = "C";
>  
>   /* Set up XKB compose table */
> +#ifdef HAVE_XKBCOMMON_COMPOSE
>   compose_table =
>   xkb_compose_table_new_from_locale(input->display->xkb_context,
> locale,
> @@ -3054,6 +3061,7 @@ keyboard_handle_keymap(void *data, struct wl_keyboard 
> *keyboard,
>   fprintf(stderr, "could not create XKB compose table for locale 
> '%s'.  "
>   "Disabiling compose\n", locale);
>   }
> +#endif
>  
>   xkb_keymap_unref(input->xkb.keymap);
>   xkb_state_unref(input->xkb.state);
> @@ -3099,6 +3107,7 @@ keyboard_handle_leave(void *data, struct wl_keyboard 
> *keyboard,
>  static xkb_keysym_t
>  process_key_press(xkb_keysym_t sym, struct input *input)
>  {
> +#ifdef HAVE_XKBCOMMON_COMPOSE
>   if (sym == XKB_KEY_NoSymbol)
>   return sym;
>   if (xkb_compose_state_feed(input->xkb.compose_state,
> @@ -3117,6 +3126,9 @@ process_key_press(xkb_keysym_t sym, struct input *input)
>   default:
>   return sym;
>   }
> +#else
> + return sym;
> +#endif
>  }
>  
>  static void
> diff --git a/configure.ac b/configure.ac
> index 37da695..1e251bf 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -146,6 +146,10 @@ AC_ARG_ENABLE(xkbcommon,
>  if test x$enable_xkbcommon = xyes; then
>   AC_DEFINE(ENABLE_XKBCOMMON, [1], [Build Weston with libxkbcommon 
> support])
>   COMPOSITOR_MODULES="$COMPOSITOR_MODULES xkbcommon >= 0.3.0"
> + PKG_CHECK_MODULES(XKBCOMMON_COMPOSE, [xkbcommon >= 0.5.0],
> +   [AC_DEFINE(HAVE_XKBCOMMON_COMPOSE, 1,
> +  [Define if xkbcommon is 0.5.0 or newer])],
> +  true)
>  fi
>  
>  AC_ARG_ENABLE(setuid-install, [  --enable-setuid-install],,
> -- 
> 2.9.3
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] clients: Make XKB compose support conditional

2016-10-23 Thread Daniel Diaz
Hello!


On 22 October 2016 at 09:09, Daniel Stone  wrote:
> Debian Jessie's version of libxkbcommon is too old for compose support,
> so rather than force people to upgrade, let's make it conditional.

Tested on Ubuntu 14.04 with libxkbcommon-dev 0.4.1.


> Signed-off-by: Daniel Stone 
Reviewed-by: Daniel Díaz 

Thanks and greetings!

Daniel Díaz
daniel.d...@linaro.org



> Cc: Bryce Harrington 
> ---
>  clients/window.c | 12 
>  configure.ac |  4 
>  2 files changed, 16 insertions(+)
>
> diff --git a/clients/window.c b/clients/window.c
> index 5e41210..84d585e 100644
> --- a/clients/window.c
> +++ b/clients/window.c
> @@ -63,7 +63,9 @@ typedef void *EGLContext;
>  #endif /* no HAVE_CAIRO_EGL */
>
>  #include 
> +#ifdef HAVE_XKBCOMMON_COMPOSE
>  #include 
> +#endif
>  #include 
>
>  #include 
> @@ -373,8 +375,10 @@ struct input {
> struct {
> struct xkb_keymap *keymap;
> struct xkb_state *state;
> +#ifdef HAVE_XKBCOMMON_COMPOSE
> struct xkb_compose_table *compose_table;
> struct xkb_compose_state *compose_state;
> +#endif
> xkb_mod_mask_t control_mask;
> xkb_mod_mask_t alt_mask;
> xkb_mod_mask_t shift_mask;
> @@ -2982,8 +2986,10 @@ keyboard_handle_keymap(void *data, struct wl_keyboard 
> *keyboard,
> struct input *input = data;
> struct xkb_keymap *keymap;
> struct xkb_state *state;
> +#ifdef HAVE_XKBCOMMON_COMPOSE
> struct xkb_compose_table *compose_table;
> struct xkb_compose_state *compose_state;
> +#endif
> char *locale;
> char *map_str;
>
> @@ -3031,6 +3037,7 @@ keyboard_handle_keymap(void *data, struct wl_keyboard 
> *keyboard,
> locale = "C";
>
> /* Set up XKB compose table */
> +#ifdef HAVE_XKBCOMMON_COMPOSE
> compose_table =
> xkb_compose_table_new_from_locale(input->display->xkb_context,
>   locale,
> @@ -3054,6 +3061,7 @@ keyboard_handle_keymap(void *data, struct wl_keyboard 
> *keyboard,
> fprintf(stderr, "could not create XKB compose table for 
> locale '%s'.  "
> "Disabiling compose\n", locale);
> }
> +#endif
>
> xkb_keymap_unref(input->xkb.keymap);
> xkb_state_unref(input->xkb.state);
> @@ -3099,6 +3107,7 @@ keyboard_handle_leave(void *data, struct wl_keyboard 
> *keyboard,
>  static xkb_keysym_t
>  process_key_press(xkb_keysym_t sym, struct input *input)
>  {
> +#ifdef HAVE_XKBCOMMON_COMPOSE
> if (sym == XKB_KEY_NoSymbol)
> return sym;
> if (xkb_compose_state_feed(input->xkb.compose_state,
> @@ -3117,6 +3126,9 @@ process_key_press(xkb_keysym_t sym, struct input *input)
> default:
> return sym;
> }
> +#else
> +   return sym;
> +#endif
>  }
>
>  static void
> diff --git a/configure.ac b/configure.ac
> index 37da695..1e251bf 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -146,6 +146,10 @@ AC_ARG_ENABLE(xkbcommon,
>  if test x$enable_xkbcommon = xyes; then
> AC_DEFINE(ENABLE_XKBCOMMON, [1], [Build Weston with libxkbcommon 
> support])
> COMPOSITOR_MODULES="$COMPOSITOR_MODULES xkbcommon >= 0.3.0"
> +   PKG_CHECK_MODULES(XKBCOMMON_COMPOSE, [xkbcommon >= 0.5.0],
> + [AC_DEFINE(HAVE_XKBCOMMON_COMPOSE, 1,
> +[Define if xkbcommon is 0.5.0 or 
> newer])],
> +  true)
>  fi
>
>  AC_ARG_ENABLE(setuid-install, [  --enable-setuid-install],,
> --
> 2.9.3
>
> ___
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston] clients: Make XKB compose support conditional

2016-10-22 Thread Daniel Stone
Debian Jessie's version of libxkbcommon is too old for compose support,
so rather than force people to upgrade, let's make it conditional.

Signed-off-by: Daniel Stone 
Cc: Bryce Harrington 
---
 clients/window.c | 12 
 configure.ac |  4 
 2 files changed, 16 insertions(+)

diff --git a/clients/window.c b/clients/window.c
index 5e41210..84d585e 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -63,7 +63,9 @@ typedef void *EGLContext;
 #endif /* no HAVE_CAIRO_EGL */
 
 #include 
+#ifdef HAVE_XKBCOMMON_COMPOSE
 #include 
+#endif
 #include 
 
 #include 
@@ -373,8 +375,10 @@ struct input {
struct {
struct xkb_keymap *keymap;
struct xkb_state *state;
+#ifdef HAVE_XKBCOMMON_COMPOSE
struct xkb_compose_table *compose_table;
struct xkb_compose_state *compose_state;
+#endif
xkb_mod_mask_t control_mask;
xkb_mod_mask_t alt_mask;
xkb_mod_mask_t shift_mask;
@@ -2982,8 +2986,10 @@ keyboard_handle_keymap(void *data, struct wl_keyboard 
*keyboard,
struct input *input = data;
struct xkb_keymap *keymap;
struct xkb_state *state;
+#ifdef HAVE_XKBCOMMON_COMPOSE
struct xkb_compose_table *compose_table;
struct xkb_compose_state *compose_state;
+#endif
char *locale;
char *map_str;
 
@@ -3031,6 +3037,7 @@ keyboard_handle_keymap(void *data, struct wl_keyboard 
*keyboard,
locale = "C";
 
/* Set up XKB compose table */
+#ifdef HAVE_XKBCOMMON_COMPOSE
compose_table =
xkb_compose_table_new_from_locale(input->display->xkb_context,
  locale,
@@ -3054,6 +3061,7 @@ keyboard_handle_keymap(void *data, struct wl_keyboard 
*keyboard,
fprintf(stderr, "could not create XKB compose table for locale 
'%s'.  "
"Disabiling compose\n", locale);
}
+#endif
 
xkb_keymap_unref(input->xkb.keymap);
xkb_state_unref(input->xkb.state);
@@ -3099,6 +3107,7 @@ keyboard_handle_leave(void *data, struct wl_keyboard 
*keyboard,
 static xkb_keysym_t
 process_key_press(xkb_keysym_t sym, struct input *input)
 {
+#ifdef HAVE_XKBCOMMON_COMPOSE
if (sym == XKB_KEY_NoSymbol)
return sym;
if (xkb_compose_state_feed(input->xkb.compose_state,
@@ -3117,6 +3126,9 @@ process_key_press(xkb_keysym_t sym, struct input *input)
default:
return sym;
}
+#else
+   return sym;
+#endif
 }
 
 static void
diff --git a/configure.ac b/configure.ac
index 37da695..1e251bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -146,6 +146,10 @@ AC_ARG_ENABLE(xkbcommon,
 if test x$enable_xkbcommon = xyes; then
AC_DEFINE(ENABLE_XKBCOMMON, [1], [Build Weston with libxkbcommon 
support])
COMPOSITOR_MODULES="$COMPOSITOR_MODULES xkbcommon >= 0.3.0"
+   PKG_CHECK_MODULES(XKBCOMMON_COMPOSE, [xkbcommon >= 0.5.0],
+ [AC_DEFINE(HAVE_XKBCOMMON_COMPOSE, 1,
+[Define if xkbcommon is 0.5.0 or newer])],
+  true)
 fi
 
 AC_ARG_ENABLE(setuid-install, [  --enable-setuid-install],,
-- 
2.9.3

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel