x11/surface: Avoid resizing if computed size didn't change

This fixes an issue where we'd resize to the previous window size during
interactive resize.
This commit is contained in:
Jonas Ådahl 2020-12-05 11:40:47 +01:00
parent 994aa41ccc
commit fd01723470
2 changed files with 8 additions and 1 deletions

View File

@ -325,11 +325,15 @@ compute_toplevel_size (GdkSurface *surface,
gdk_surface_constrain_size (&geometry, mask,
size.width, size.height,
&size.width, &size.height);
if ((impl->next_layout.configured_width != size.width ||
if ((impl->last_computed_width != size.width ||
impl->last_computed_height != size.height) &&
(impl->next_layout.configured_width != size.width ||
impl->next_layout.configured_height != size.height))
{
*width = size.width;
*height = size.height;
impl->last_computed_width = size.width;
impl->last_computed_height = size.height;
return TRUE;
}

View File

@ -72,6 +72,9 @@ struct _GdkX11Surface
int unscaled_width;
int unscaled_height;
int last_computed_width;
int last_computed_height;
GdkToplevelLayout *toplevel_layout;
struct {