summaryrefslogtreecommitdiff
path: root/gtk/gtkwindow.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-11-12 19:16:11 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-11-12 19:16:11 +0000
commit2cb2d33b2086617fcb8d968f08bde3e60e09a9f7 (patch)
treecbc6bbde17abfff2378b0feaa305c9dda25a0c1f /gtk/gtkwindow.c
parent114d0b6b25d64d70d68997d64d46b561ecfe4e46 (diff)
downloadgdk-pixbuf-2cb2d33b2086617fcb8d968f08bde3e60e09a9f7.tar.gz
Fix problem with using result of g_get_charset() backwards - pointed out
Sun Nov 12 14:10:09 2000 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix problem with using result of g_get_charset() backwards - pointed out by Mikael Hermansson <mikeh@bahnhof.se>. * gtk/gtkwindow.c (gtk_window_compute_hints): Support negative min_width/height and max_width/height to mean "requisition"; this allows setting a window to be user-resizable in only one direction easily. * gtk/testgtk.c (create_main_window): Remove hard-coded usize - set a default size in the vertical direction.
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r--gtk/gtkwindow.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index dbf9ecaf8..821f9d855 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -2125,8 +2125,15 @@ gtk_window_compute_hints (GtkWindow *window,
if (*new_flags & GDK_HINT_MIN_SIZE)
{
- new_geometry->min_width += extra_width;
- new_geometry->min_height += extra_height;
+ if (new_geometry->min_width < 0)
+ new_geometry->min_width = requisition.width;
+ else
+ new_geometry->min_width += extra_width;
+
+ if (new_geometry->min_height < 0)
+ new_geometry->min_width = requisition.height;
+ else
+ new_geometry->min_height += extra_height;
}
else if (!window->allow_shrink)
{
@@ -2138,8 +2145,15 @@ gtk_window_compute_hints (GtkWindow *window,
if (*new_flags & GDK_HINT_MAX_SIZE)
{
- new_geometry->max_width += extra_width;
- new_geometry->max_height += extra_height;
+ if (new_geometry->max_width < 0)
+ new_geometry->max_width = requisition.width;
+ else
+ new_geometry->max_width += extra_width;
+
+ if (new_geometry->max_height < 0)
+ new_geometry->max_width = requisition.height;
+ else
+ new_geometry->max_height += extra_height;
}
else if (!window->allow_grow)
{