[gtk: 72/88] x11/surface: Avoid resizing if computed size didn't change
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk: 72/88] x11/surface: Avoid resizing if computed size didn't change
- Date: Tue, 8 Dec 2020 15:38:47 +0000 (UTC)
commit fd01723470aa694f5f0b25929d2434846bbb1535
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Sat Dec 5 11:40:47 2020 +0100
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.
gdk/x11/gdksurface-x11.c | 6 +++++-
gdk/x11/gdksurface-x11.h | 3 +++
2 files changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index e80e0beff4..6680312563 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -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;
}
diff --git a/gdk/x11/gdksurface-x11.h b/gdk/x11/gdksurface-x11.h
index 134ebdf617..0830407dd0 100644
--- a/gdk/x11/gdksurface-x11.h
+++ b/gdk/x11/gdksurface-x11.h
@@ -72,6 +72,9 @@ struct _GdkX11Surface
int unscaled_width;
int unscaled_height;
+ int last_computed_width;
+ int last_computed_height;
+
GdkToplevelLayout *toplevel_layout;
struct {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]