fepitre / rpms / gtk3

Forked from rpms/gtk3 4 years ago
Clone

Blame SOURCES/0001-window-Sanitize-size-hint-computation.patch

8d4952
From 9849b292a9d524de374b501424e9499fe6964c83 Mon Sep 17 00:00:00 2001
8d4952
From: Benjamin Otte <otte@redhat.com>
8d4952
Date: Sat, 14 Dec 2013 01:15:06 +0100
8d4952
Subject: [PATCH] window: Sanitize size hint computation
8d4952
8d4952
We don't want the maximum size to be smaller than the minimum size. Not
8d4952
just because it's wrong but also because when this happens the rest of
8d4952
GTK gets mighty confused and infloops resizing to min-size and
8d4952
max-size in turns causing a flickering window. Well, at least if you
8d4952
run X without a window manager. Or your window manager hasn't finished
8d4952
starting up.
8d4952
8d4952
Private RHEL bug finding this issue:
8d4952
https://bugzilla.redhat.com/show_bug.cgi?id=1035409
8d4952
---
8d4952
 gtk/gtkwindow.c | 15 +++++++--------
8d4952
 1 file changed, 7 insertions(+), 8 deletions(-)
8d4952
8d4952
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
8d4952
index 92b8f7e..5c6d018 100644
8d4952
--- a/gtk/gtkwindow.c
8d4952
+++ b/gtk/gtkwindow.c
8d4952
@@ -9177,22 +9177,21 @@ gtk_window_compute_hints (GtkWindow   *window,
8d4952
   
8d4952
   if (*new_flags & GDK_HINT_MAX_SIZE)
8d4952
     {
8d4952
-      if (new_geometry->max_width < 0)
8d4952
-	new_geometry->max_width = requisition.width;
8d4952
-      else
8d4952
+      if (new_geometry->max_width >= 0)
8d4952
 	new_geometry->max_width += extra_width;
8d4952
+      new_geometry->max_width = MAX (new_geometry->max_width, new_geometry->min_width);
8d4952
 
8d4952
-      if (new_geometry->max_height < 0)
8d4952
-	new_geometry->max_height = requisition.height;
8d4952
-      else
8d4952
+      if (new_geometry->max_height >= 0)
8d4952
 	new_geometry->max_height += extra_height;
8d4952
+
8d4952
+      new_geometry->max_height = MAX (new_geometry->max_height, new_geometry->min_height);
8d4952
     }
8d4952
   else if (!priv->resizable)
8d4952
     {
8d4952
       *new_flags |= GDK_HINT_MAX_SIZE;
8d4952
       
8d4952
-      new_geometry->max_width = requisition.width;
8d4952
-      new_geometry->max_height = requisition.height;
8d4952
+      new_geometry->max_width = new_geometry->min_width;
8d4952
+      new_geometry->max_height = new_geometry->min_height;
8d4952
     }
8d4952
 
8d4952
   *new_flags |= GDK_HINT_WIN_GRAVITY;
8d4952
-- 
8d4952
1.8.4.2
8d4952