From 23bf48063ff6d3150cee99715f0f1b48ebd4a82e Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Tue, 10 Jul 2012 13:05:00 +0300 Subject: [PATCH] server: add lose_touch_focus() Just like wl_keyboard and wl_pointer, add a signal handler for losing touch focus. Signed-off-by: Pekka Paalanen --- src/wayland-server.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wayland-server.c b/src/wayland-server.c index 9f9d6b3a..82ed3260 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -497,6 +497,15 @@ lose_keyboard_focus(struct wl_listener *listener, void *data) keyboard->focus_resource = NULL; } +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