From a6674b9ea8b6ed062799b2ebf05d32f0e8e5d9f9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 16 Sep 2008 04:54:13 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20551987=20=E2=80=93=20GtkPaned=20redrawing?= =?UTF-8?q?=20problem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-09-16 Matthias Clasen Bug 551987 – GtkPaned redrawing problem * gtk/gtkpaned.c: Remove excess invalidations. Patch by Owen Taylor svn path=/trunk/; revision=21400 --- ChangeLog | 6 ++++++ gtk/gtkpaned.c | 16 ++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac59e660d2..140ce37852 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-09-16 Matthias Clasen + + Bug 551987 – GtkPaned redrawing problem + + * gtk/gtkpaned.c: Remove excess invalidations. Patch by Owen Taylor + 2008-09-16 Matthias Clasen Bug 551987 – GtkPaned redrawing problem diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index c556b1d440..4f2db528a5 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -536,7 +536,11 @@ static void gtk_paned_init (GtkPaned *paned) { GTK_WIDGET_SET_FLAGS (paned, GTK_NO_WINDOW | GTK_CAN_FOCUS); - + + /* We only need to redraw when the handle position moves, which is + * independent of the overall allocation of the GtkPaned */ + gtk_widget_set_redraw_on_allocate (GTK_WIDGET (paned), FALSE); + paned->child1 = NULL; paned->child2 = NULL; paned->handle = NULL; @@ -577,7 +581,7 @@ gtk_paned_set_property (GObject *object, break; case PROP_POSITION_SET: paned->position_set = g_value_get_boolean (value); - gtk_widget_queue_resize (GTK_WIDGET (paned)); + gtk_widget_queue_resize_no_redraw (GTK_WIDGET (paned)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -658,7 +662,7 @@ gtk_paned_set_child_property (GtkContainer *container, break; } if (old_value != new_value) - gtk_widget_queue_resize (GTK_WIDGET (container)); + gtk_widget_queue_resize_no_redraw (GTK_WIDGET (container)); } static void @@ -1145,7 +1149,7 @@ gtk_paned_remove (GtkContainer *container, paned->child1 = NULL; if (was_visible && GTK_WIDGET_VISIBLE (container)) - gtk_widget_queue_resize (GTK_WIDGET (container)); + gtk_widget_queue_resize_no_redraw (GTK_WIDGET (container)); } else if (paned->child2 == widget) { @@ -1154,7 +1158,7 @@ gtk_paned_remove (GtkContainer *container, paned->child2 = NULL; if (was_visible && GTK_WIDGET_VISIBLE (container)) - gtk_widget_queue_resize (GTK_WIDGET (container)); + gtk_widget_queue_resize_no_redraw (GTK_WIDGET (container)); } } @@ -1232,7 +1236,7 @@ gtk_paned_set_position (GtkPaned *paned, g_object_notify (object, "position-set"); g_object_thaw_notify (object); - gtk_widget_queue_resize (GTK_WIDGET (paned)); + gtk_widget_queue_resize_no_redraw (GTK_WIDGET (paned)); #ifdef G_OS_WIN32 /* Hacky work-around for bug #144269 */