diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2016-09-16 15:07:22 +0800 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2016-09-18 10:58:38 +0800 |
commit | 417757eab8540d3e0330a1ed76a09e99433a4c76 (patch) | |
tree | 1d55def5ee55e21d88453bf58fc39051da410e14 /src | |
parent | 32b87e7bea89906e5cb4838dfb87d586f54fa4bf (diff) | |
download | mutter-417757eab8540d3e0330a1ed76a09e99433a4c76.tar.gz |
wayland: Handle parent-less popup commits
A xdg_popup, when active, always has a parent surface. However, a popup
created may immediately become invalid, for example when it is not
granted a grab, in which case it won't be assigned a parent since it
will never be mapped.
This case needs to be handled elsewhere, as one cannot assume a
MetaWaylandXdgPoup that is processed (via wl_surface commit handling
etc) will have a parent_surface.
https://bugzilla.gnome.org/show_bug.cgi?id=771495
Diffstat (limited to 'src')
-rw-r--r-- | src/wayland/meta-wayland-xdg-shell.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c index 329068316..e9223a9a2 100644 --- a/src/wayland/meta-wayland-xdg-shell.c +++ b/src/wayland/meta-wayland-xdg-shell.c @@ -856,7 +856,10 @@ xdg_popup_role_get_toplevel (MetaWaylandSurfaceRole *surface_role) { MetaWaylandXdgPopup *xdg_popup = META_WAYLAND_XDG_POPUP (surface_role); - return meta_wayland_surface_get_toplevel (xdg_popup->parent_surface); + if (xdg_popup->parent_surface) + return meta_wayland_surface_get_toplevel (xdg_popup->parent_surface); + else + return NULL; } static void |