forked from enlightenment/enlightenment
bugfix: Check for parent surface before creating popup
xdg_shell requires a parent surface in order to create a popup, so we should check the validity of the parent resource and error out accordingly Summary: Signed-off-by: vivek <vivek.ellur@samsung.com> Reviewers: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1388
This commit is contained in:
parent
8a10f288ad
commit
992f999301
|
@ -1324,6 +1324,15 @@ _e_xdg_shell_cb_popup_get(struct wl_client *client, struct wl_resource *resource
|
|||
return;
|
||||
}
|
||||
|
||||
/* check for the parent surface */
|
||||
if (!parent_resource)
|
||||
{
|
||||
wl_resource_post_error(surface_resource,
|
||||
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
||||
"Popup requires a parent shell surface");
|
||||
return;
|
||||
}
|
||||
|
||||
/* try to create a shell surface */
|
||||
if (!(cdata->shell.surface =
|
||||
wl_resource_create(client, &xdg_popup_interface, 1, id)))
|
||||
|
|
Loading…
Reference in New Issue