mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -05:00
wayland/xdg-shell: Check popup parent type when assigning
We only allow mapping popups on top of surfaces with a xdg_surface based role. Add a check and fail clients that doesn't follow this rule. https://bugzilla.gnome.org/show_bug.cgi?id=790358
This commit is contained in:
parent
5d3b4f0134
commit
c533a06e93
@ -1553,6 +1553,14 @@ xdg_surface_constructor_get_popup (struct wl_client *client,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!META_IS_WAYLAND_XDG_SURFACE (parent_surface->role))
|
||||
{
|
||||
wl_resource_post_error (xdg_shell_resource,
|
||||
ZXDG_SHELL_V6_ERROR_INVALID_POPUP_PARENT,
|
||||
"Invalid popup parent role");
|
||||
return;
|
||||
}
|
||||
|
||||
xdg_popup = META_WAYLAND_XDG_POPUP (surface->role);
|
||||
xdg_popup->resource = wl_resource_create (client,
|
||||
&zxdg_popup_v6_interface,
|
||||
|
Loading…
Reference in New Issue
Block a user