[PATCH weston] xwm: Check whether the seat is NULL sometimes in weston_wm_handle_button

Boyan Ding stu_dby at 126.com
Fri Aug 29 07:10:32 PDT 2014


Under some certain circumstances, pointer button may have been released
when frame is still being resized/moved. When this happens, the picked
seat is NULL and it will segfault when moving/resizing surfaces. Check
whether the seat is NULL and ignore move/resize in that case.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=82827
Signed-off-by: Boyan Ding <stu_dby at 126.com>
---
 xwayland/window-manager.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index a216b76..f633324 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -1648,12 +1648,14 @@ weston_wm_handle_button(struct weston_wm *wm, xcb_generic_event_t *event)
 		weston_wm_window_schedule_repaint(window);
 
 	if (frame_status(window->frame) & FRAME_STATUS_MOVE) {
-		shell_interface->move(window->shsurf, seat);
+		if (seat != NULL)
+			shell_interface->move(window->shsurf, seat);
 		frame_status_clear(window->frame, FRAME_STATUS_MOVE);
 	}
 
 	if (frame_status(window->frame) & FRAME_STATUS_RESIZE) {
-		shell_interface->resize(window->shsurf, seat, location);
+		if (seat != NULL)
+			shell_interface->resize(window->shsurf, seat, location);
 		frame_status_clear(window->frame, FRAME_STATUS_RESIZE);
 	}
 
-- 
2.1.0




More information about the wayland-devel mailing list