input: Unset focus of seat device when releasing last reference
authorJonas Ådahl <jadahl@gmail.com>
Thu, 17 Oct 2013 21:04:06 +0000 (23:04 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 21 Oct 2013 20:46:33 +0000 (13:46 -0700)
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 <jadahl@gmail.com>
src/input.c

index d1acd92..6e14766 100644 (file)
@@ -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);
        }
 }