The following action will crash weston:
1. launch gnome-terminal under xwayland in weston
2. click on the right side of the menubar (right of "Help" menu)
weston will immediately crash when mouse button is released.
The reason is Xwayland will somehow send a client message type of moveresize when pointer is released, and weston_wm_window_handle_moveresize will call weston_wm_pick_seat_for_window, which will always turn NULL if there is no button pressed. Then weston_wm_pick_seat_for_window will immediately dereference the NULL pointer.
There are two possible ways if we want to solve the problem on weston side:
1. remove the seat->pointer->button_count > 0 condition in weston_wm_pick_pointer_for_window to let it return a possible seat
2. check in weston_wm_window_handle_moveresize whether the returned seat is NULL.
Which is the more appropriate approach?
Proposed patch at: http://lists.freedesktop.org/archives/wayland-devel/2014-July/015886.html
Uses the second approach.
Committed as c06a180dd574c24ca50766461c10d3a6bfa3ad2b.
FWIW, I couldn't reproduce the problem before or after the patch. Maybe it was fixed elsewhere.