mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-04 13:29:51 -05:00
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 <ppaalanen@gmail.com>
This commit is contained in:
parent
e7e1296682
commit
23bf48063f
1 changed files with 10 additions and 0 deletions
|
|
@ -497,6 +497,15 @@ lose_keyboard_focus(struct wl_listener *listener, void *data)
|
||||||
keyboard->focus_resource = NULL;
|
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
|
static void
|
||||||
default_grab_focus(struct wl_pointer_grab *grab,
|
default_grab_focus(struct wl_pointer_grab *grab,
|
||||||
struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y)
|
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);
|
memset(touch, 0, sizeof *touch);
|
||||||
wl_list_init(&touch->resource_list);
|
wl_list_init(&touch->resource_list);
|
||||||
|
touch->focus_listener.notify = lose_touch_focus;
|
||||||
}
|
}
|
||||||
|
|
||||||
WL_EXPORT void
|
WL_EXPORT void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue