Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/wayland/meta-wayland-subsurface.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ meta_wayland_subsurface_union_geometry (MetaWaylandSubsurface *subsurface,
.height = meta_wayland_surface_get_height (surface),
};

meta_rectangle_union (out_geometry, &geometry, out_geometry);
if (surface->buffer_ref.buffer)
meta_rectangle_union (out_geometry, &geometry, out_geometry);

META_WAYLAND_SURFACE_FOREACH_SUBSURFACE (surface, subsurface_surface)
{
Expand Down
18 changes: 18 additions & 0 deletions src/wayland/meta-wayland-xdg-shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,15 @@ xdg_surface_set_window_geometry (struct wl_client *client,
MetaWaylandSurface *surface = surface_from_xdg_surface_resource (resource);
MetaWaylandSurfaceState *pending;

if (width == 0 || height == 0)
{
g_warning ("Invalid geometry %dx%d+%d+%d set on xdg_surface@%d. Ignoring for "
"now, but this will result in client termination in the future.",
width, height, x, y,
wl_resource_get_id (resource));
return;
}

pending = meta_wayland_surface_get_pending_state (surface);
pending->has_new_geometry = TRUE;
pending->new_geometry.x = x;
Expand Down Expand Up @@ -1581,6 +1590,15 @@ meta_wayland_xdg_surface_post_apply_state (MetaWaylandSurfaceRole *surface_role
meta_wayland_shell_surface_determine_geometry (shell_surface,
&pending->new_geometry,
&priv->geometry);
if (priv->geometry.width == 0 || priv->geometry.height == 0)
{
g_warning ("Invalid window geometry for xdg_surface@%d. Ignoring "
"for now, but this will result in client termination "
"in the future.",
wl_resource_get_id (priv->resource));
return;
}

priv->has_set_geometry = TRUE;
}
else if (priv->has_set_geometry)
Expand Down
Loading