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
13 changes: 11 additions & 2 deletions src/wayland/meta-wayland-xdg-shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ typedef struct _MetaWaylandXdgSurfacePrivate
struct wl_resource *resource;
MetaWaylandXdgShellClient *shell_client;
MetaRectangle geometry;
MetaRectangle unconstrained_geometry;

guint configure_sent : 1;
guint first_buffer_attached : 1;
Expand Down Expand Up @@ -807,7 +808,7 @@ meta_wayland_xdg_toplevel_post_apply_state (MetaWaylandSurfaceRole *surface_rol
META_WAYLAND_SURFACE_ROLE_CLASS (meta_wayland_xdg_toplevel_parent_class);
surface_role_class->post_apply_state (surface_role, pending);

if (!pending->newly_attached)
if (!surface->buffer_ref.buffer)
return;

window_geometry = meta_wayland_xdg_surface_get_window_geometry (xdg_surface);
Expand Down Expand Up @@ -1533,6 +1534,7 @@ meta_wayland_xdg_surface_real_reset (MetaWaylandXdgSurface *xdg_surface)
priv->first_buffer_attached = FALSE;
priv->configure_sent = FALSE;
priv->geometry = (MetaRectangle) { 0 };
priv->unconstrained_geometry = (MetaRectangle) { 0 };
priv->has_set_geometry = FALSE;
}

Expand Down Expand Up @@ -1575,12 +1577,19 @@ meta_wayland_xdg_surface_post_apply_state (MetaWaylandSurfaceRole *surface_role

if (pending->has_new_geometry)
{
priv->unconstrained_geometry = pending->new_geometry;
meta_wayland_shell_surface_determine_geometry (shell_surface,
&pending->new_geometry,
&priv->geometry);
priv->has_set_geometry = TRUE;
}
else if (!priv->has_set_geometry)
else if (priv->has_set_geometry)
{
meta_wayland_shell_surface_determine_geometry (shell_surface,
&priv->unconstrained_geometry,
&priv->geometry);
}
else
{
MetaRectangle new_geometry = { 0 };

Expand Down
15 changes: 14 additions & 1 deletion src/wayland/meta-window-wayland.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ struct _MetaWindowWayland
GList *pending_configurations;
gboolean has_pending_state_change;

gboolean has_last_sent_configuration;
int last_sent_x;
int last_sent_y;
int last_sent_width;
Expand Down Expand Up @@ -188,6 +189,10 @@ surface_state_changed (MetaWindow *window)
if (window->unmanaging)
return;

g_return_if_fail (wl_window->has_last_sent_configuration);
if (!wl_window->has_last_sent_configuration)
return;

configuration =
meta_wayland_window_configuration_new (wl_window->last_sent_x,
wl_window->last_sent_y,
Expand Down Expand Up @@ -401,6 +406,7 @@ meta_window_wayland_move_resize_internal (MetaWindow *window,
}
}

wl_window->has_last_sent_configuration = TRUE;
wl_window->last_sent_x = configured_x;
wl_window->last_sent_y = configured_y;
wl_window->last_sent_width = configured_width;
Expand Down Expand Up @@ -1000,7 +1006,14 @@ meta_window_wayland_finish_move_resize (MetaWindow *window,
else
{
if (acked_configuration)
calculate_offset (acked_configuration, &new_geom, &rect);
{
calculate_offset (acked_configuration, &new_geom, &rect);
}
else
{
rect.x = window->rect.x;
rect.y = window->rect.y;
}
}

if (rect.x != window->rect.x || rect.y != window->rect.y)
Expand Down
Loading