From: Kristian Høgsberg Date: Thu, 2 Jan 2014 00:28:32 +0000 (-0800) Subject: shell: Only assign focus on click if there is a pointer focus surface X-Git-Tag: upstream/0.1.8~549 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7c4f6cc145daf66cd9624f1e70dd5278241f5858;p=profile%2Fivi%2Fweston-ivi-shell.git shell: Only assign focus on click if there is a pointer focus surface If we don't have a background image from the desktop-shell client or the pointer for some other reason doesn't have a focus we trigger a segfault as we try to deref the seat->pointer->focus NULL pointer. https://bugs.freedesktop.org/show_bug.cgi?id=73066 --- diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c index 4e7a815..f96dcf1 100644 --- a/clients/desktop-shell.c +++ b/clients/desktop-shell.c @@ -765,7 +765,7 @@ background_configure(void *data, struct background *background = (struct background *) window_get_user_data(window); - widget_schedule_resize(background->widget, width, height); + widget_schedule_resize(background->widget, width - 256, height); } static void diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 7981099..e22c97f 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -4216,6 +4216,8 @@ click_to_activate_binding(struct weston_seat *seat, uint32_t time, uint32_t butt { if (seat->pointer->grab != &seat->pointer->default_grab) return; + if (seat->pointer->focus == NULL) + return; activate_binding(seat, data, seat->pointer->focus->surface); }