summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRui Matos <tiagomatos@gmail.com>2015-08-04 12:24:16 +0200
committerRui Matos <tiagomatos@gmail.com>2015-08-05 13:50:09 +0200
commit9c745105f8503349860d7e800c662f77ce57a1a8 (patch)
treeffb1e4479b3c9ddd8a4e8f437371ffaa5a999cac /src
parentab9dabe7251deeafdd2bff13a22f123df528c5cb (diff)
downloadmutter-9c745105f8503349860d7e800c662f77ce57a1a8.tar.gz
wayland-surface: Send out an error for a popup with an invalid parent
Instead of silently failing without the client noticing. https://bugzilla.gnome.org/show_bug.cgi?id=753237
Diffstat (limited to 'src')
-rw-r--r--src/wayland/meta-wayland-surface.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index ef9edf61a..1849ece99 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -1365,9 +1365,6 @@ xdg_shell_get_xdg_popup (struct wl_client *client,
MetaDisplay *display = meta_get_display ();
MetaWaylandPopup *popup;
- if (parent_surf == NULL || parent_surf->window == NULL)
- return;
-
if (surface->xdg_popup != NULL)
{
wl_resource_post_error (surface_resource,
@@ -1382,7 +1379,9 @@ xdg_shell_get_xdg_popup (struct wl_client *client,
XDG_SHELL_ERROR_ROLE) != 0)
return;
- if (parent_surf->xdg_popup == NULL && parent_surf->xdg_surface == NULL)
+ if (parent_surf == NULL ||
+ parent_surf->window == NULL ||
+ (parent_surf->xdg_popup == NULL && parent_surf->xdg_surface == NULL))
{
wl_resource_post_error (resource,
XDG_POPUP_ERROR_INVALID_PARENT,