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