From a71e8019433b32923eb04c4b2f8065476ccfb2e1 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 3 Mar 2011 18:24:58 -0500 Subject: [PATCH] GtkNotebook: Don't let tab allocation go negative --- gtk/gtknotebook.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index e50dc6f40c..a7740d5069 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -5740,7 +5740,7 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook, { case GTK_POS_TOP: case GTK_POS_BOTTOM: - child_allocation.width = page->requisition.width + tab_overlap + tab_extra_space; + child_allocation.width = MAX (1, page->requisition.width + tab_overlap + tab_extra_space); /* make sure that the reordered tab doesn't go past the last position */ if (priv->operation == DRAG_OPERATION_REORDER && @@ -5795,7 +5795,7 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook, break; case GTK_POS_LEFT: case GTK_POS_RIGHT: - child_allocation.height = page->requisition.height + tab_overlap + tab_extra_space; + child_allocation.height = MAX (1, page->requisition.height + tab_overlap + tab_extra_space); /* make sure that the reordered tab doesn't go past the last position */ if (priv->operation == DRAG_OPERATION_REORDER &&