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>
dev
Derek Foreman 10 years ago committed by Pekka Paalanen
parent 35b7f25ae3
commit 3dd570e754
  1. 7
      desktop-shell/exposay.c

@ -519,6 +519,7 @@ exposay_set_inactive(struct desktop_shell *shell)
struct weston_seat *seat = shell->exposay.seat; struct weston_seat *seat = shell->exposay.seat;
weston_keyboard_end_grab(seat->keyboard); weston_keyboard_end_grab(seat->keyboard);
if (seat->pointer_device_count)
weston_pointer_end_grab(seat->pointer); weston_pointer_end_grab(seat->pointer);
if (seat->keyboard->input_method_resource) if (seat->keyboard->input_method_resource)
seat->keyboard->grab = &seat->keyboard->input_method_grab; 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); weston_keyboard_set_focus(seat->keyboard, NULL);
shell->exposay.grab_ptr.interface = &exposay_ptr_grab; shell->exposay.grab_ptr.interface = &exposay_ptr_grab;
if (seat->pointer_device_count) {
weston_pointer_start_grab(seat->pointer, weston_pointer_start_grab(seat->pointer,
&shell->exposay.grab_ptr); &shell->exposay.grab_ptr);
weston_pointer_set_focus(seat->pointer, NULL, weston_pointer_set_focus(seat->pointer, NULL,
seat->pointer->x, seat->pointer->y); seat->pointer->x,
seat->pointer->y);
}
wl_list_for_each(shell_output, &shell->output_list, link) { wl_list_for_each(shell_output, &shell->output_list, link) {
enum exposay_layout_state state; enum exposay_layout_state state;

Loading…
Cancel
Save