summaryrefslogtreecommitdiff
path: root/gtk/gtkscrolledwindow.c
diff options
context:
space:
mode:
authorOwen Taylor <owt1@cornell.edu>1998-04-03 23:17:16 +0000
committerOwen Taylor <otaylor@src.gnome.org>1998-04-03 23:17:16 +0000
commit32cd050cfe286e636d4df6d96a4b46936279a5a6 (patch)
tree4f45bb5081e616ff501d984ea7c3481e0d43ab74 /gtk/gtkscrolledwindow.c
parent740b70ea0c1bcdb5943b85ed0bba434f73f9a292 (diff)
downloadgtk+-32cd050cfe286e636d4df6d96a4b46936279a5a6.tar.gz
More extensive debugging output
Fri Apr 3 17:14:55 1998 Owen Taylor <owt1@cornell.edu> * gdk/gdk.c: More extensive debugging output * gtk/gtkalignment.c gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtkclist.c gtk/gtkeventbox.c gtk/gtkhandlebox.c gtk/gtk[hv]box.c gtk/gtk[hv]paned.c gtk/gtklist.c gtk/gtkmenu.c gtk/gtkmenubar.c gtk/gtkmenuitem.c gtk/gtknotebook.c gtk/gtktable.c gtk/gtktree.c gtk/gtktreeitem.c gtk/gtkviewport.c Avoid assigning negative values to unsigned allocation.width and height * gtk/gtkwindow.c: Instead of realizing the widget, then size allocating, (resulting in XMoveResizeWindows for all children, do the size allocation first, then realize. In gtk_real_window_move_resize, combine move and resize into a single GDK/X call when possible. * gtk/gtkclist.c gtk/gtkdrawingarea.c: Remove assumption that the widget will be size allocated _after_ it is realized. * gtk/gtklist.c (gtk_list_motion_notify): Removed useless debugging message.
Diffstat (limited to 'gtk/gtkscrolledwindow.c')
-rw-r--r--gtk/gtkscrolledwindow.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index c840fe03ad..f69c7f70e5 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -493,13 +493,15 @@ gtk_scrolled_window_viewport_allocate (GtkWidget *widget,
allocation->x = GTK_CONTAINER (widget)->border_width;
allocation->y = GTK_CONTAINER (widget)->border_width;
- allocation->width = widget->allocation.width - allocation->x * 2;
- allocation->height = widget->allocation.height - allocation->y * 2;
+ allocation->width = MAX (0, widget->allocation.width - allocation->x * 2);
+ allocation->height = MAX (0, widget->allocation.height - allocation->y * 2);
if (GTK_WIDGET_VISIBLE (scrolled_window->vscrollbar))
- allocation->width -= scrolled_window->vscrollbar->requisition.width + SCROLLBAR_SPACING (scrolled_window);
+ allocation->width = MAX (0,
+ allocation->width - (scrolled_window->vscrollbar->requisition.width + SCROLLBAR_SPACING (scrolled_window)));
if (GTK_WIDGET_VISIBLE (scrolled_window->hscrollbar))
- allocation->height -= scrolled_window->hscrollbar->requisition.height + SCROLLBAR_SPACING (scrolled_window);
+ allocation->height = MAX (0,
+ allocation->height - (scrolled_window->hscrollbar->requisition.height + SCROLLBAR_SPACING (scrolled_window)));
}
static void