summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Brüschweiler <blei42@gmail.com>2013-04-15 21:09:54 +0200
committerKristian Høgsberg <krh@bitplanet.net>2013-04-15 21:13:34 -0400
commit63e7be60b3f78b73aac583a28e5f855a76f29dd5 (patch)
tree6788f5a6e6939decde8295c021e22336721bb375
parent96386b8e5ef222025acbb5fe604244e626eb8573 (diff)
shell: clear popup grab interface on remove_popup_grab and popup_grab_end
Fixes a segfault. Steps to reproduce: * start weston with the x11 backend * open a terminal * click on the icon in the top left corner, choose close * close the x11 window containing weston
-rw-r--r--src/shell.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shell.c b/src/shell.c
index de5d6f6e..9d0ae02f 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1986,6 +1986,8 @@ popup_grab_end(struct wl_pointer *pointer)
if (pointer->grab->interface == &popup_grab_interface) {
wl_pointer_end_grab(grab->pointer);
shseat->popup_grab.client = NULL;
+ shseat->popup_grab.grab.interface = NULL;
+ assert(!wl_list_empty(&shseat->popup_grab.surfaces_list));
/* Send the popup_done event to all the popups open */
wl_list_for_each(shsurf, &shseat->popup_grab.surfaces_list, popup.grab_link) {
wl_shell_surface_send_popup_done(&shsurf->resource);
@@ -2028,6 +2030,7 @@ remove_popup_grab(struct shell_surface *shsurf)
wl_list_init(&shsurf->popup.grab_link);
if (wl_list_empty(&shseat->popup_grab.surfaces_list)) {
wl_pointer_end_grab(shseat->popup_grab.grab.pointer);
+ shseat->popup_grab.grab.interface = NULL;
}
}