From cee82d62865ab5b239935f102c2e1f7868e0fa65 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 15 Jul 2015 13:00:33 -0500 Subject: [PATCH] exposay: Test keyboard presence before using keyboard pointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We shouldn't actually use the keyboard pointer unless we check that a keyboard is present. Reviewed-by: Jonas Ã…dahl Signed-off-by: Derek Foreman --- desktop-shell/exposay.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/desktop-shell/exposay.c b/desktop-shell/exposay.c index ea2a3751..e59d17e5 100644 --- a/desktop-shell/exposay.c +++ b/desktop-shell/exposay.c @@ -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; }