mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-21 20:35:58 +01:00
xdg-popup: validate parent
This matches Mutter's behavior. Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3576
This commit is contained in:
parent
2926acf60d
commit
e315068b98
1 changed files with 6 additions and 0 deletions
|
@ -376,6 +376,12 @@ void create_xdg_popup(struct wlr_xdg_surface *surface,
|
|||
return;
|
||||
}
|
||||
|
||||
if (parent != NULL && parent->role == WLR_XDG_SURFACE_ROLE_NONE) {
|
||||
wl_resource_post_error(surface->client->resource, XDG_WM_BASE_ERROR_INVALID_POPUP_PARENT,
|
||||
"a popup parent must have a role");
|
||||
return;
|
||||
}
|
||||
|
||||
assert(surface->popup == NULL);
|
||||
surface->popup = calloc(1, sizeof(struct wlr_xdg_popup));
|
||||
if (!surface->popup) {
|
||||
|
|
Loading…
Reference in a new issue