From 7c4d83de53be31fa143bffaaad153438b543a710 Mon Sep 17 00:00:00 2001 From: Samuel Iglesias Gonsalvez Date: Fri, 21 Jun 2013 10:17:12 +0200 Subject: [PATCH] clients/window.c: fix SIGSEGV when setting cursor image to stopped client SIGSEGV when client is stopped and weston-desktop-shell tries to set the cursor image. This happens when the user tries to click on a stopped client or move client's window. Signed-off-by: Samuel Iglesias Gonsalvez --- clients/window.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clients/window.c b/clients/window.c index c13d207..443c65f 100644 --- a/clients/window.c +++ b/clients/window.c @@ -2810,12 +2810,15 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer, widget = input->grab; else widget = input->focus_widget; - if (widget && widget->motion_handler) + if (widget && widget->motion_handler) { cursor = widget->motion_handler(input->focus_widget, input, time, sx, sy, widget->user_data); - else + } else { + if (!input->focus_widget) + return; cursor = input->focus_widget->default_cursor; + } input_set_pointer_image(input, cursor); } -- 1.8.1.4