From 630bae8672d9562f1f7a56e3680718a07c14fb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 17 Oct 2013 23:04:06 +0200 Subject: [PATCH] input: Unset focus of seat device when releasing last reference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the last input device with a certain capability is removed, unset the focus of the seat device associated with the capability. Signed-off-by: Jonas Ã…dahl --- src/input.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/input.c b/src/input.c index d1acd926..6e147666 100644 --- a/src/input.c +++ b/src/input.c @@ -1680,6 +1680,7 @@ weston_seat_release_keyboard(struct weston_seat *seat) { seat->keyboard_device_count--; if (seat->keyboard_device_count == 0) { + weston_keyboard_set_focus(seat->keyboard, NULL); seat_send_updated_caps(seat); } } @@ -1714,6 +1715,10 @@ weston_seat_release_pointer(struct weston_seat *seat) seat->pointer_device_count--; if (seat->pointer_device_count == 0) { + weston_pointer_set_focus(pointer, NULL, + wl_fixed_from_int(0), + wl_fixed_from_int(0)); + seat_send_updated_caps(seat); } } @@ -1746,6 +1751,7 @@ weston_seat_release_touch(struct weston_seat *seat) { seat->touch_device_count--; if (seat->touch_device_count == 0) { + weston_touch_set_focus(seat, NULL); seat_send_updated_caps(seat); } }