mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
xdg-shell: check for existing role before setting xdg_popup_surface_role
Hopefully fixes #2056
This commit is contained in:
parent
58bcec9d94
commit
b2bd536308
1 changed files with 5 additions and 5 deletions
|
|
@ -288,11 +288,6 @@ void create_xdg_popup(struct wlr_xdg_surface *xdg_surface,
|
||||||
return;
|
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) {
|
if (xdg_surface->role != WLR_XDG_SURFACE_ROLE_NONE) {
|
||||||
wl_resource_post_error(xdg_surface->resource,
|
wl_resource_post_error(xdg_surface->resource,
|
||||||
XDG_SURFACE_ERROR_ALREADY_CONSTRUCTED,
|
XDG_SURFACE_ERROR_ALREADY_CONSTRUCTED,
|
||||||
|
|
@ -300,6 +295,11 @@ void create_xdg_popup(struct wlr_xdg_surface *xdg_surface,
|
||||||
return;
|
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);
|
assert(xdg_surface->popup == NULL);
|
||||||
xdg_surface->popup = calloc(1, sizeof(struct wlr_xdg_popup));
|
xdg_surface->popup = calloc(1, sizeof(struct wlr_xdg_popup));
|
||||||
if (!xdg_surface->popup) {
|
if (!xdg_surface->popup) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue