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
This commit is contained in:
parent
6f64d6b0aa
commit
8b0b0cf028
@ -351,12 +351,6 @@ toplevel_surface_commit (MetaWaylandSurfaceRole *surface_role,
|
|||||||
return;
|
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
|
else
|
||||||
{
|
{
|
||||||
if (surface->buffer == NULL)
|
if (surface->buffer == NULL)
|
||||||
@ -369,10 +363,11 @@ toplevel_surface_commit (MetaWaylandSurfaceRole *surface_role,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_assert (window != NULL);
|
/* 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
|
||||||
/* We resize X based surfaces according to X events */
|
* wl_shell_surface wl_surface, xdg_surface object was destroyed, etc).
|
||||||
if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND)
|
*/
|
||||||
|
if (window && window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND)
|
||||||
{
|
{
|
||||||
MetaRectangle geom = { 0 };
|
MetaRectangle geom = { 0 };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user