[PATCH wayland 1/4] server: add lose_touch_focus()

Kristian Høgsberg hoegsberg at gmail.com
Tue Jul 10 11:03:43 PDT 2012


On Tue, Jul 10, 2012 at 01:05:00PM +0300, Pekka Paalanen wrote:
> Just like wl_keyboard and wl_pointer, add a signal handler for losing
> touch focus.

I've applied this one since it's a step in the right direction, but we
need to pull more generic touch logic from weston into wayland.  We'll
need at least wl_touch_set_focus().

thanks,
Kristian

> Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
> ---
>  src/wayland-server.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/src/wayland-server.c b/src/wayland-server.c
> index 9f9d6b3..82ed326 100644
> --- a/src/wayland-server.c
> +++ b/src/wayland-server.c
> @@ -498,6 +498,15 @@ lose_keyboard_focus(struct wl_listener *listener, void *data)
>  }
>  
>  static void
> +lose_touch_focus(struct wl_listener *listener, void *data)
> +{
> +	struct wl_touch *touch =
> +		container_of(listener, struct wl_touch, focus_listener);
> +
> +	touch->focus_resource = NULL;
> +}
> +
> +static void
>  default_grab_focus(struct wl_pointer_grab *grab,
>  		   struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y)
>  {
> @@ -666,6 +675,7 @@ wl_touch_init(struct wl_touch *touch)
>  {
>  	memset(touch, 0, sizeof *touch);
>  	wl_list_init(&touch->resource_list);
> +	touch->focus_listener.notify = lose_touch_focus;
>  }
>  
>  WL_EXPORT void
> -- 
> 1.7.8.6
> 


More information about the wayland-devel mailing list