summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2015-05-22 11:47:20 -0500
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-05-26 12:48:12 +0300
commit3dd570e754102b940a0177d5bdb18e9accada639 (patch)
tree1f93fa8043471f35be1c0c03cf1f4da7059da482
parent35b7f25ae3bcdd88a0d9f9fa4c4d7ae4975dcd09 (diff)
downloadweston-3dd570e754102b940a0177d5bdb18e9accada639.tar.gz
weston-3dd570e754102b940a0177d5bdb18e9accada639.tar.bz2
weston-3dd570e754102b940a0177d5bdb18e9accada639.zip
exposay: Don't crash if no pointer is present
If the compositor has never seen a mouse, exposay will crash because the seat->pointer pointer is NULL. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
-rw-r--r--desktop-shell/exposay.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/desktop-shell/exposay.c b/desktop-shell/exposay.c
index 4b65cbd1..78e45fb6 100644
--- a/desktop-shell/exposay.c
+++ b/desktop-shell/exposay.c
@@ -519,7 +519,8 @@ exposay_set_inactive(struct desktop_shell *shell)
struct weston_seat *seat = shell->exposay.seat;
weston_keyboard_end_grab(seat->keyboard);
- weston_pointer_end_grab(seat->pointer);
+ 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;
@@ -570,11 +571,13 @@ exposay_transition_active(struct desktop_shell *shell)
weston_keyboard_set_focus(seat->keyboard, NULL);
shell->exposay.grab_ptr.interface = &exposay_ptr_grab;
- weston_pointer_start_grab(seat->pointer,
- &shell->exposay.grab_ptr);
- weston_pointer_set_focus(seat->pointer, NULL,
- seat->pointer->x, seat->pointer->y);
-
+ if (seat->pointer_device_count) {
+ weston_pointer_start_grab(seat->pointer,
+ &shell->exposay.grab_ptr);
+ weston_pointer_set_focus(seat->pointer, NULL,
+ seat->pointer->x,
+ seat->pointer->y);
+ }
wl_list_for_each(shell_output, &shell->output_list, link) {
enum exposay_layout_state state;