gtk/gtklayout.c (gtk_layout_realize), gtk/gtkiconview.c

Mon May 15 15:12:05 2006  Søren Sandmann  <sandmann@redhat.com>

	* gtk/gtklayout.c (gtk_layout_realize),
	* gtk/gtkiconview.c (gtk_icon_view_realize),
	* gtk/gtktreeview.c (gtk_tree_view_realize): Set the background of
	the clip windows to NULL, since they are generally invisible and
	don't have EXPOSURE set, which means they temp-unvlicker code
	doesn't apply to them.

	* gdk/x11/gdkgeometry-x11.c (_gdk_window_move_resize_child): Unset
	the background of the parent window during resizing. Invalidate
	the uncoered area of the parent window. Bug 341332.
This commit is contained in:
Søren Sandmann 2006-05-15 19:17:30 +00:00 committed by Søren Sandmann Pedersen
parent 4080181c45
commit 6cb19cf3ad
7 changed files with 69 additions and 15 deletions

View File

@ -1,3 +1,16 @@
Mon May 15 15:12:05 2006 Søren Sandmann <sandmann@redhat.com>
* gtk/gtklayout.c (gtk_layout_realize),
* gtk/gtkiconview.c (gtk_icon_view_realize),
* gtk/gtktreeview.c (gtk_tree_view_realize): Set the background of
the clip windows to NULL, since they are generally invisible and
don't have EXPOSURE set, which means they temp-unvlicker code
doesn't apply to them.
* gdk/x11/gdkgeometry-x11.c (_gdk_window_move_resize_child): Unset
the background of the parent window during resizing. Invalidate
the uncoered area of the parent window. Bug 341332.
2006-05-15 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkevents-quartz.c (_gdk_events_init): Remove obsolete

View File

@ -1,3 +1,16 @@
Mon May 15 15:12:05 2006 Søren Sandmann <sandmann@redhat.com>
* gtk/gtklayout.c (gtk_layout_realize),
* gtk/gtkiconview.c (gtk_icon_view_realize),
* gtk/gtktreeview.c (gtk_tree_view_realize): Set the background of
the clip windows to NULL, since they are generally invisible and
don't have EXPOSURE set, which means they temp-unvlicker code
doesn't apply to them.
* gdk/x11/gdkgeometry-x11.c (_gdk_window_move_resize_child): Unset
the background of the parent window during resizing. Invalidate
the uncoered area of the parent window. Bug 341332.
2006-05-15 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkevents-quartz.c (_gdk_events_init): Remove obsolete

View File

@ -572,6 +572,17 @@ gdk_window_move_region (GdkWindow *window,
gdk_region_destroy (dest_region);
}
static void
reset_backgrounds (GdkWindow *window)
{
GdkWindowObject *obj = (GdkWindowObject *)window;
_gdk_x11_window_tmp_reset_bg (window, FALSE);
if (obj->parent)
_gdk_x11_window_tmp_reset_bg ((GdkWindow *)obj->parent, FALSE);
}
void
_gdk_window_move_resize_child (GdkWindow *window,
gint x,
@ -589,13 +600,15 @@ _gdk_window_move_resize_child (GdkWindow *window,
gint dx, dy;
gboolean is_move;
gboolean is_resize;
GdkRectangle old_pos;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (GDK_IS_WINDOW (window));
impl = GDK_WINDOW_IMPL_X11 (GDK_WINDOW_OBJECT (window)->impl);
obj = GDK_WINDOW_OBJECT (window);
dx = x - obj->x;
dy = y - obj->y;
@ -605,6 +618,11 @@ _gdk_window_move_resize_child (GdkWindow *window,
if (!is_move && !is_resize)
return;
old_pos.x = obj->x;
old_pos.y = obj->y;
old_pos.width = impl->width;
old_pos.height = impl->height;
obj->x = x;
obj->y = y;
impl->width = width;
@ -657,9 +675,8 @@ _gdk_window_move_resize_child (GdkWindow *window,
XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
new_info.x, new_info.y, new_info.width, new_info.height);
if (impl->position_info.no_bg)
_gdk_x11_window_tmp_reset_bg (window, FALSE);
reset_backgrounds (window);
if (!impl->position_info.mapped && new_info.mapped && GDK_WINDOW_IS_MAPPED (obj))
XMapWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window));
@ -704,14 +721,16 @@ _gdk_window_move_resize_child (GdkWindow *window,
tmp_list = tmp_list->next;
}
if (impl->position_info.no_bg)
_gdk_x11_window_tmp_reset_bg (window, FALSE);
reset_backgrounds (window);
if (!impl->position_info.mapped && new_info.mapped && GDK_WINDOW_IS_MAPPED (obj))
XMapWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window));
impl->position_info = new_info;
}
if (GDK_WINDOW_IS_MAPPED (obj) && obj->parent)
gdk_window_invalidate_rect ((GdkWindow *)obj->parent, &old_pos, FALSE);
}
static void
@ -964,8 +983,7 @@ gdk_window_postmove (GdkWindow *window,
if (!impl->position_info.mapped && new_info.mapped && GDK_WINDOW_IS_MAPPED (obj))
XMapWindow (GDK_DRAWABLE_XDISPLAY (window), GDK_DRAWABLE_XID (window));
if (impl->position_info.no_bg)
_gdk_x11_window_tmp_reset_bg (window, FALSE);
reset_backgrounds (window);
impl->position_info = new_info;
@ -1233,6 +1251,9 @@ gdk_window_clip_changed (GdkWindow *window, GdkRectangle *old_clip, GdkRectangle
gdk_window_invalidate_region (window, new_clip_region, FALSE);
}
if (obj->parent)
_gdk_x11_window_tmp_unset_bg ((GdkWindow *)obj->parent, FALSE);
gdk_region_destroy (new_clip_region);
gdk_region_destroy (old_clip_region);
}

View File

@ -257,6 +257,13 @@ tmp_reset_bg (GdkWindow *window)
}
}
/* Unsetting and resetting window backgrounds.
*
* In many cases it is possible to avoid flicker by unsetting the
* background of windows. For example if the background of the
* parent window is unset when a window is unmapped, a brief flicker
* of background painting is avoided.
*/
void
_gdk_x11_window_tmp_unset_bg (GdkWindow *window,
gboolean recurse)

View File

@ -1105,6 +1105,7 @@ gtk_icon_view_realize (GtkWidget *widget)
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
gdk_window_set_user_data (widget->window, widget);
/* Make the window for the icon view */
@ -1127,7 +1128,6 @@ gtk_icon_view_realize (GtkWidget *widget)
widget->style = gtk_style_attach (widget->style, widget->window);
gdk_window_set_background (icon_view->priv->bin_window, &widget->style->base[widget->state]);
gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
gdk_window_show (icon_view->priv->bin_window);
}

View File

@ -842,6 +842,7 @@ gtk_layout_realize (GtkWidget *widget)
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
gdk_window_set_user_data (widget->window, widget);
attributes.x = - layout->hadjustment->value,
@ -856,7 +857,6 @@ gtk_layout_realize (GtkWidget *widget)
gdk_window_set_user_data (layout->bin_window, widget);
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
gtk_style_set_background (widget->style, layout->bin_window, GTK_STATE_NORMAL);
tmp_list = layout->children;

View File

@ -1630,7 +1630,7 @@ gtk_tree_view_realize (GtkWidget *widget)
/* Add them all up. */
widget->style = gtk_style_attach (widget->style, widget->window);
gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
gdk_window_set_background (tree_view->priv->bin_window, &widget->style->base[widget->state]);
gtk_style_set_background (widget->style, tree_view->priv->header_window, GTK_STATE_NORMAL);
@ -7083,7 +7083,7 @@ gtk_tree_view_style_set (GtkWidget *widget,
if (GTK_WIDGET_REALIZED (widget))
{
gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
gdk_window_set_background (tree_view->priv->bin_window, &widget->style->base[widget->state]);
}
@ -13689,7 +13689,7 @@ gtk_tree_view_state_changed (GtkWidget *widget,
if (GTK_WIDGET_REALIZED (widget))
{
gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
gdk_window_set_background (tree_view->priv->bin_window, &widget->style->base[widget->state]);
}