xwm: Check whether the seat is NULL when needed in weston_wm_handle_button
authorBoyan Ding <stu_dby@126.com>
Wed, 3 Sep 2014 09:25:30 +0000 (17:25 +0800)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 3 Sep 2014 13:07:34 +0000 (16:07 +0300)
commit3c6d20c5eb51d20dce337961a3a5e5342315da49
treeccc379aa829ad61f89ded65e5d64457b12a814fd
parentde7e2b3ce3d8a929b47b6248c42364b2510c65ab
xwm: Check whether the seat is NULL when needed in weston_wm_handle_button

XCB and wayland input event handling exists together in xwm, which can
cause problems. weston_wm_handle_button is called via XCB events, while
it calls weston_wm_pick_seat_for_window, which uses info from compositor
(pure wayland). It is also true in setting and removing flags of frames.
Races can happen in between, when resize of moving flag of the frame is
still set while the button has been released, the picked seat will be
NULL in weston_wm_handle_button, causing crash. We can safely ignore
moving or resizing if this happens. The same applies to c06a180d.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=82827
Signed-off-by: Boyan Ding <stu_dby@126.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
xwayland/window-manager.c