diff options
author | Alexander Larsson <alexl@redhat.com> | 2009-10-05 22:07:06 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2009-10-05 22:07:06 +0200 |
commit | c5d086117982b1997389afd08a52ddaf2fdf8254 (patch) | |
tree | 3278054f42c358ec1f6399a0122f3d42fee08d93 /gtk/gtkwindow.c | |
parent | 786b589d95077b465dcc2311ff2489ee7bb9a49f (diff) | |
download | gtk+-c5d086117982b1997389afd08a52ddaf2fdf8254.tar.gz |
Don't request window sizes with zero width or height
Zero width/height is unsupported and will magically be turned into one.
For instance, gtk_widget_size_allocate() will eventually do this magic
on the value stored in widget->allocation.
However, if we don't do this magic conversion early, then the value
returned from gtk_window_compute_configure_request() will not be
comparable with whats stored in widget->allocation. (I.E. they will
differ if width or height are zero).
This is dangerous, as we do such a comparison in gtk_window_move_resize().
Currently a change from e.g. 10x1 (current allocation) to 10x0 (new size)
will be expected to produce a ConfigureNotify, when it actually won't,
thus never thawing the frozen toplevel.
Fixes bug #588059
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r-- | gtk/gtkwindow.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index c0815a9322..36c5a65193 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -5648,6 +5648,13 @@ gtk_window_compute_configure_request_size (GtkWindow *window, if (info->resize_height > 0) *height = info->resize_height; } + + /* Don't ever request zero width or height, its not supported by + gdk. The size allocation code will round it to 1 anyway but if + we do it then the value returned from this function will is + not comparable to the size allocation read from the GtkWindow. */ + *width = MAX (*width, 1); + *height = MAX (*height, 1); } static GtkWindowPosition |