diff --git a/src/input.c b/src/input.c index 15ff6ed0..c59c2697 100644 --- a/src/input.c +++ b/src/input.c @@ -2168,6 +2168,7 @@ WL_EXPORT void weston_seat_release_keyboard(struct weston_seat *seat) { seat->keyboard_device_count--; + assert(seat->keyboard_device_count >= 0); if (seat->keyboard_device_count == 0) { weston_keyboard_set_focus(seat->keyboard, NULL); weston_keyboard_cancel_grab(seat->keyboard); diff --git a/src/libinput-device.c b/src/libinput-device.c index 0e3f46de..8a48905f 100644 --- a/src/libinput-device.c +++ b/src/libinput-device.c @@ -470,7 +470,7 @@ evdev_notify_keyboard_focus(struct weston_seat *seat, { struct wl_array keys; - if (!seat->keyboard_device_count > 0) + if (seat->keyboard_device_count == 0) return; wl_array_init(&keys);