Bug 551987 – GtkPaned redrawing problem

2008-09-16  Matthias Clasen  <mclasen@redhat.com>

        Bug 551987 – GtkPaned redrawing problem

        * gtk/gtkhpaned.c:
        * gtk/gtkvpaned.c: Queue invalidations when the handle is moved
        due to child changes. Patch by Owen Taylor


svn path=/trunk/; revision=21399
This commit is contained in:
Matthias Clasen
2008-09-16 04:51:56 +00:00
committed by Matthias Clasen
parent a05204154c
commit da8dac8320
3 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2008-09-16 Matthias Clasen <mclasen@redhat.com>
Bug 551987 GtkPaned redrawing problem
* gtk/gtkhpaned.c:
* gtk/gtkvpaned.c: Queue invalidations when the handle is moved
due to child changes. Patch by Owen Taylor
2008-09-16 Matthias Clasen <mclasen@redhat.com>
Bug 552001 gtkimcontextsimple.c: variable is declared at middle of

View File

@ -130,6 +130,7 @@ gtk_hpaned_size_allocate (GtkWidget *widget,
GtkAllocation child2_allocation;
GtkRequisition child1_requisition;
GtkRequisition child2_requisition;
GdkRectangle old_handle_pos;
gint handle_size;
gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
@ -144,6 +145,8 @@ gtk_hpaned_size_allocate (GtkWidget *widget,
child1_requisition.width,
child2_requisition.width);
old_handle_pos = paned->handle_pos;
paned->handle_pos.x = widget->allocation.x + paned->child1_size + border_width;
paned->handle_pos.y = widget->allocation.y + border_width;
paned->handle_pos.width = handle_size;
@ -164,6 +167,14 @@ gtk_hpaned_size_allocate (GtkWidget *widget,
flip_child (widget, &(paned->handle_pos));
}
if (GTK_WIDGET_MAPPED (widget) &&
(old_handle_pos.x != paned->handle_pos.x || old_handle_pos.y != paned->handle_pos.y ||
old_handle_pos.width != paned->handle_pos.width || old_handle_pos.height != paned->handle_pos.height))
{
gdk_window_invalidate_rect (widget->window, &old_handle_pos, FALSE);
gdk_window_invalidate_rect (widget->window, &paned->handle_pos, FALSE);
}
if (GTK_WIDGET_REALIZED (widget))
{
if (GTK_WIDGET_MAPPED (widget))

View File

@ -125,6 +125,7 @@ gtk_vpaned_size_allocate (GtkWidget *widget,
GtkRequisition child2_requisition;
GtkAllocation child1_allocation;
GtkAllocation child2_allocation;
GdkRectangle old_handle_pos;
gint handle_size;
gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
@ -139,11 +140,21 @@ gtk_vpaned_size_allocate (GtkWidget *widget,
child1_requisition.height,
child2_requisition.height);
old_handle_pos = paned->handle_pos;
paned->handle_pos.x = widget->allocation.x + border_width;
paned->handle_pos.y = widget->allocation.y + paned->child1_size + border_width;
paned->handle_pos.width = MAX (1, (gint) widget->allocation.width - 2 * border_width);
paned->handle_pos.height = handle_size;
if (GTK_WIDGET_MAPPED (widget) &&
(old_handle_pos.x != paned->handle_pos.x || old_handle_pos.y != paned->handle_pos.y ||
old_handle_pos.width != paned->handle_pos.width || old_handle_pos.height != paned->handle_pos.height))
{
gdk_window_invalidate_rect (widget->window, &old_handle_pos, FALSE);
gdk_window_invalidate_rect (widget->window, &paned->handle_pos, FALSE);
}
if (GTK_WIDGET_REALIZED (widget))
{
if (GTK_WIDGET_MAPPED (widget))