exposay: Test keyboard presence before using keyboard pointer
authorDerek Foreman <derekf@osg.samsung.com>
Wed, 15 Jul 2015 18:00:33 +0000 (13:00 -0500)
committerBryce Harrington <bryce@osg.samsung.com>
Fri, 17 Jul 2015 02:03:32 +0000 (19:03 -0700)
We shouldn't actually use the keyboard pointer unless we check that
a keyboard is present.

Reviewed-by: Jonas Ã…dahl <jadahl@gmail.com>
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
desktop-shell/exposay.c

index ea2a37512b8353a638c2b28ca5f889c0a853e2ba..e59d17e5c4a30939d3d9dfabfe26042ebe448fbe 100644 (file)
@@ -520,11 +520,14 @@ exposay_set_inactive(struct desktop_shell *shell)
 {
        struct weston_seat *seat = shell->exposay.seat;
 
-       weston_keyboard_end_grab(seat->keyboard);
        if (seat->pointer_device_count)
                weston_pointer_end_grab(seat->pointer);
-       if (seat->keyboard->input_method_resource)
-               seat->keyboard->grab = &seat->keyboard->input_method_grab;
+
+       if (!seat->keyboard_device_count) {
+               weston_keyboard_end_grab(seat->keyboard);
+               if (seat->keyboard->input_method_resource)
+                       seat->keyboard->grab = &seat->keyboard->input_method_grab;
+       }
 
        return EXPOSAY_LAYOUT_INACTIVE;
 }