aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-04-07 12:21:21 -0400
committerDrew DeVault <sir@cmpwn.com>2018-04-07 12:21:21 -0400
commitbf68854a38f867c3553d51394e78a6e17de1798c (patch)
tree788a1b2b3ac09aa7a8aa27e42deb85e50b2cdb4a
parentf4125220a58f508d54f5103d4b0580f1d047f6b9 (diff)
Fix destruction of popups without grabs
Fixes #846
-rw-r--r--types/wlr_xdg_shell.c7
-rw-r--r--types/wlr_xdg_shell_v6.c7
2 files changed, 2 insertions, 12 deletions
diff --git a/types/wlr_xdg_shell.c b/types/wlr_xdg_shell.c
index 43ccd5aa..d4848e35 100644
--- a/types/wlr_xdg_shell.c
+++ b/types/wlr_xdg_shell.c
@@ -589,13 +589,8 @@ static void xdg_popup_handle_destroy(struct wl_client *client,
struct wl_resource *resource) {
struct wlr_xdg_surface *surface =
xdg_surface_from_xdg_popup_resource(resource);
- struct wlr_xdg_popup_grab *grab =
- xdg_shell_popup_grab_from_seat(surface->client->shell,
- surface->popup->seat);
- struct wlr_xdg_surface *topmost =
- xdg_popup_grab_get_topmost(grab);
- if (topmost != surface) {
+ if (!wl_list_empty(&surface->popups)) {
wl_resource_post_error(surface->client->resource,
XDG_WM_BASE_ERROR_NOT_THE_TOPMOST_POPUP,
"xdg_popup was destroyed while it was not the topmost popup");
diff --git a/types/wlr_xdg_shell_v6.c b/types/wlr_xdg_shell_v6.c
index e7a35f97..f1258f0f 100644
--- a/types/wlr_xdg_shell_v6.c
+++ b/types/wlr_xdg_shell_v6.c
@@ -545,13 +545,8 @@ static void xdg_popup_handle_destroy(struct wl_client *client,
struct wl_resource *resource) {
struct wlr_xdg_surface_v6 *surface =
xdg_surface_from_xdg_popup_resource(resource);
- struct wlr_xdg_popup_grab_v6 *grab =
- xdg_shell_popup_grab_from_seat(surface->client->shell,
- surface->popup->seat);
- struct wlr_xdg_surface_v6 *topmost =
- xdg_popup_grab_get_topmost(grab);
- if (topmost != surface) {
+ if (!wl_list_empty(&surface->popups)) {
wl_resource_post_error(surface->client->resource,
ZXDG_SHELL_V6_ERROR_NOT_THE_TOPMOST_POPUP,
"xdg_popup was destroyed while it was not the topmost popup");