summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2015-09-24 08:24:54 +0800
committerJonas Ådahl <jadahl@gmail.com>2015-09-29 09:09:57 +0800
commit8b0b0cf028fcbe9a39db0c10f313668c74b0981b (patch)
treec26f69643c3891d72c4ea5e56fedf20bdb7c6fe7
parent6f64d6b0aa8e8d054183624815c605f84a985c71 (diff)
downloadmutter-8b0b0cf028fcbe9a39db0c10f313668c74b0981b.tar.gz
MetaWaylandSurface: Don't assume a toplevel always have a MetaWindow
When committing a toplevel surface we might no longer have a MetaWindow associated with it. The reason may vary but some are: a popup was dismissed, the client attached and committed a NULL buffer to a wl_surface with the wl_shell_surface role, the client committed a buffer to a wl_surface which previously had an toplevel window role which extension object was destroyed. https://bugzilla.gnome.org/show_bug.cgi?id=755490
-rw-r--r--src/wayland/meta-wayland-surface.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 2d7a9c721..f51b124e6 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -351,12 +351,6 @@ toplevel_surface_commit (MetaWaylandSurfaceRole *surface_role,
return;
}
}
- else if (META_IS_WAYLAND_SURFACE_ROLE_XDG_POPUP (surface->role))
- {
- /* Ignore commits if we couldn't grab the pointer */
- if (!window)
- return;
- }
else
{
if (surface->buffer == NULL)
@@ -369,10 +363,11 @@ toplevel_surface_commit (MetaWaylandSurfaceRole *surface_role,
}
}
- g_assert (window != NULL);
-
- /* We resize X based surfaces according to X events */
- if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND)
+ /* Update the state of the MetaWindow if we still have one. We might not if
+ * the window was unmanaged (for example popup destroyed, NULL buffer attached to
+ * wl_shell_surface wl_surface, xdg_surface object was destroyed, etc).
+ */
+ if (window && window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND)
{
MetaRectangle geom = { 0 };