From: Rob Bradford Date: Wed, 26 Jun 2013 18:49:11 +0000 (+0100) Subject: shell: Allow ending of popup grabs from within the starting of the grab X-Git-Tag: 1.1.91~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dfe310512b4ed8f5dd591611b61a5dfd114403b0;p=platform%2Fupstream%2Fweston.git shell: Allow ending of popup grabs from within the starting of the grab Calling weston_pointer_start_grab can lead to a code path (in this case when the shell surface is unresponsive) that can try and remove the popup grab to setup a shell grab. Ending the popup grab requires removing the surface from the grab's surfaces list - however the grab had not yet been fully setup so the grabbed surface was not yet in this list. With this change we ensure we add the surface to the list before setting up the pointer grab. https://bugs.freedesktop.org/show_bug.cgi?id=66167 --- diff --git a/src/shell.c b/src/shell.c index 4f93d3b..3b6ac42 100644 --- a/src/shell.c +++ b/src/shell.c @@ -2122,9 +2122,11 @@ add_popup_grab(struct shell_surface *shsurf, struct shell_seat *shseat) if (shseat->seat->pointer->button_count > 0) shseat->popup_grab.initial_up = 0; + wl_list_insert(&shseat->popup_grab.surfaces_list, &shsurf->popup.grab_link); weston_pointer_start_grab(seat->pointer, &shseat->popup_grab.grab); + } else { + wl_list_insert(&shseat->popup_grab.surfaces_list, &shsurf->popup.grab_link); } - wl_list_insert(&shseat->popup_grab.surfaces_list, &shsurf->popup.grab_link); } static void