aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg V <greg@unrelenting.technology>2020-07-04 00:25:18 +0300
committerSimon Ser <contact@emersion.fr>2020-07-04 12:11:19 +0200
commitb2bd536308ddac7fb9f163be8d7788f54f9ee20c (patch)
tree1a123787b430c977821cf8a218bd153821843e57
parent58bcec9d9490b1421611854aaf5ca3ece4581f27 (diff)
downloadwlroots-b2bd536308ddac7fb9f163be8d7788f54f9ee20c.tar.xz
xdg-shell: check for existing role before setting xdg_popup_surface_role
Hopefully fixes #2056
-rw-r--r--types/xdg_shell/wlr_xdg_popup.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/types/xdg_shell/wlr_xdg_popup.c b/types/xdg_shell/wlr_xdg_popup.c
index 057e69b8..d71e6ef3 100644
--- a/types/xdg_shell/wlr_xdg_popup.c
+++ b/types/xdg_shell/wlr_xdg_popup.c
@@ -288,11 +288,6 @@ void create_xdg_popup(struct wlr_xdg_surface *xdg_surface,
return;
}
- if (!wlr_surface_set_role(xdg_surface->surface, &xdg_popup_surface_role,
- xdg_surface, xdg_surface->resource, XDG_WM_BASE_ERROR_ROLE)) {
- return;
- }
-
if (xdg_surface->role != WLR_XDG_SURFACE_ROLE_NONE) {
wl_resource_post_error(xdg_surface->resource,
XDG_SURFACE_ERROR_ALREADY_CONSTRUCTED,
@@ -300,6 +295,11 @@ void create_xdg_popup(struct wlr_xdg_surface *xdg_surface,
return;
}
+ if (!wlr_surface_set_role(xdg_surface->surface, &xdg_popup_surface_role,
+ xdg_surface, xdg_surface->resource, XDG_WM_BASE_ERROR_ROLE)) {
+ return;
+ }
+
assert(xdg_surface->popup == NULL);
xdg_surface->popup = calloc(1, sizeof(struct wlr_xdg_popup));
if (!xdg_surface->popup) {