Skip to content

Commit a92dc19

Browse files
mtwebsterclefebvre
authored andcommitted
xdg-shell: Don't warn on geometry committed before first buffer.
1 parent 2ff6d62 commit a92dc19

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/wayland/meta-wayland-xdg-shell.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,8 +1734,22 @@ meta_wayland_xdg_surface_post_apply_state (MetaWaylandSurfaceRole *surface_role
17341734
meta_wayland_shell_surface_determine_geometry (shell_surface,
17351735
&pending->new_geometry,
17361736
&priv->geometry);
1737+
17371738
if (priv->geometry.width == 0 || priv->geometry.height == 0)
17381739
{
1740+
MetaWaylandSurface *surface =
1741+
meta_wayland_surface_role_get_surface (surface_role);
1742+
1743+
/* A client may commit window geometry before attaching its first
1744+
* buffer (e.g. answering an initial maximized configure). The
1745+
* geometry can't be resolved against an empty surface; defer
1746+
* silently until a buffer arrives rather than warning. */
1747+
if (!surface->buffer_ref->buffer)
1748+
{
1749+
priv->has_set_geometry = TRUE;
1750+
return;
1751+
}
1752+
17391753
g_warning ("Invalid window geometry for xdg_surface@%d. Ignoring "
17401754
"for now, but this will result in client termination "
17411755
"in the future.",

0 commit comments

Comments
 (0)