Commit 6cb19cf3 authored by Søren Sandmann's avatar Søren Sandmann Committed by Søren Sandmann Pedersen
Browse files

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.
parent 4080181c
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> 2006-05-15 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkevents-quartz.c (_gdk_events_init): Remove obsolete * gdk/quartz/gdkevents-quartz.c (_gdk_events_init): Remove obsolete
......
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> 2006-05-15 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkevents-quartz.c (_gdk_events_init): Remove obsolete * gdk/quartz/gdkevents-quartz.c (_gdk_events_init): Remove obsolete
......
...@@ -572,6 +572,17 @@ gdk_window_move_region (GdkWindow *window, ...@@ -572,6 +572,17 @@ gdk_window_move_region (GdkWindow *window,
gdk_region_destroy (dest_region); 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 void
_gdk_window_move_resize_child (GdkWindow *window, _gdk_window_move_resize_child (GdkWindow *window,
gint x, gint x,
...@@ -589,13 +600,15 @@ _gdk_window_move_resize_child (GdkWindow *window, ...@@ -589,13 +600,15 @@ _gdk_window_move_resize_child (GdkWindow *window,
gint dx, dy; gint dx, dy;
gboolean is_move; gboolean is_move;
gboolean is_resize; gboolean is_resize;
GdkRectangle old_pos;
g_return_if_fail (window != NULL); 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); impl = GDK_WINDOW_IMPL_X11 (GDK_WINDOW_OBJECT (window)->impl);
obj = GDK_WINDOW_OBJECT (window); obj = GDK_WINDOW_OBJECT (window);
dx = x - obj->x; dx = x - obj->x;
dy = y - obj->y; dy = y - obj->y;
...@@ -605,6 +618,11 @@ _gdk_window_move_resize_child (GdkWindow *window, ...@@ -605,6 +618,11 @@ _gdk_window_move_resize_child (GdkWindow *window,
if (!is_move && !is_resize) if (!is_move && !is_resize)
return; 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->x = x;
obj->y = y; obj->y = y;
impl->width = width; impl->width = width;
...@@ -657,9 +675,8 @@ _gdk_window_move_resize_child (GdkWindow *window, ...@@ -657,9 +675,8 @@ _gdk_window_move_resize_child (GdkWindow *window,
XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window), XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), GDK_WINDOW_XID (window),
new_info.x, new_info.y, new_info.width, new_info.height); new_info.x, new_info.y, new_info.width, new_info.height);
if (impl->position_info.no_bg) reset_backgrounds (window);
_gdk_x11_window_tmp_reset_bg (window, FALSE);
if (!impl->position_info.mapped && new_info.mapped && GDK_WINDOW_IS_MAPPED (obj)) if (!impl->position_info.mapped && new_info.mapped && GDK_WINDOW_IS_MAPPED (obj))
XMapWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window)); XMapWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window));
...@@ -704,14 +721,16 @@ _gdk_window_move_resize_child (GdkWindow *window, ...@@ -704,14 +721,16 @@ _gdk_window_move_resize_child (GdkWindow *window,
tmp_list = tmp_list->next; tmp_list = tmp_list->next;
} }
if (impl->position_info.no_bg) reset_backgrounds (window);
_gdk_x11_window_tmp_reset_bg (window, FALSE);
if (!impl->position_info.mapped && new_info.mapped && GDK_WINDOW_IS_MAPPED (obj)) if (!impl->position_info.mapped && new_info.mapped && GDK_WINDOW_IS_MAPPED (obj))
XMapWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window)); XMapWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window));
impl->position_info = new_info; 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 static void
...@@ -964,8 +983,7 @@ gdk_window_postmove (GdkWindow *window, ...@@ -964,8 +983,7 @@ gdk_window_postmove (GdkWindow *window,
if (!impl->position_info.mapped && new_info.mapped && GDK_WINDOW_IS_MAPPED (obj)) if (!impl->position_info.mapped && new_info.mapped && GDK_WINDOW_IS_MAPPED (obj))
XMapWindow (GDK_DRAWABLE_XDISPLAY (window), GDK_DRAWABLE_XID (window)); XMapWindow (GDK_DRAWABLE_XDISPLAY (window), GDK_DRAWABLE_XID (window));
if (impl->position_info.no_bg) reset_backgrounds (window);
_gdk_x11_window_tmp_reset_bg (window, FALSE);
impl->position_info = new_info; impl->position_info = new_info;
...@@ -1233,6 +1251,9 @@ gdk_window_clip_changed (GdkWindow *window, GdkRectangle *old_clip, GdkRectangle ...@@ -1233,6 +1251,9 @@ gdk_window_clip_changed (GdkWindow *window, GdkRectangle *old_clip, GdkRectangle
gdk_window_invalidate_region (window, new_clip_region, FALSE); 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 (new_clip_region);
gdk_region_destroy (old_clip_region); gdk_region_destroy (old_clip_region);
} }
......
...@@ -257,6 +257,13 @@ tmp_reset_bg (GdkWindow *window) ...@@ -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 void
_gdk_x11_window_tmp_unset_bg (GdkWindow *window, _gdk_x11_window_tmp_unset_bg (GdkWindow *window,
gboolean recurse) gboolean recurse)
......
...@@ -1105,6 +1105,7 @@ gtk_icon_view_realize (GtkWidget *widget) ...@@ -1105,6 +1105,7 @@ gtk_icon_view_realize (GtkWidget *widget)
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask); &attributes, attributes_mask);
gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
gdk_window_set_user_data (widget->window, widget); gdk_window_set_user_data (widget->window, widget);
/* Make the window for the icon view */ /* Make the window for the icon view */
...@@ -1127,7 +1128,6 @@ gtk_icon_view_realize (GtkWidget *widget) ...@@ -1127,7 +1128,6 @@ gtk_icon_view_realize (GtkWidget *widget)
widget->style = gtk_style_attach (widget->style, widget->window); 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 (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); gdk_window_show (icon_view->priv->bin_window);
} }
......
...@@ -842,6 +842,7 @@ gtk_layout_realize (GtkWidget *widget) ...@@ -842,6 +842,7 @@ gtk_layout_realize (GtkWidget *widget)
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask); &attributes, attributes_mask);
gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
gdk_window_set_user_data (widget->window, widget); gdk_window_set_user_data (widget->window, widget);
attributes.x = - layout->hadjustment->value, attributes.x = - layout->hadjustment->value,
...@@ -856,7 +857,6 @@ gtk_layout_realize (GtkWidget *widget) ...@@ -856,7 +857,6 @@ gtk_layout_realize (GtkWidget *widget)
gdk_window_set_user_data (layout->bin_window, widget); gdk_window_set_user_data (layout->bin_window, widget);
widget->style = gtk_style_attach (widget->style, widget->window); 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); gtk_style_set_background (widget->style, layout->bin_window, GTK_STATE_NORMAL);
tmp_list = layout->children; tmp_list = layout->children;
......
...@@ -1630,7 +1630,7 @@ gtk_tree_view_realize (GtkWidget *widget) ...@@ -1630,7 +1630,7 @@ gtk_tree_view_realize (GtkWidget *widget)
/* Add them all up. */ /* Add them all up. */
widget->style = gtk_style_attach (widget->style, widget->window); 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]); 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); 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, ...@@ -7083,7 +7083,7 @@ gtk_tree_view_style_set (GtkWidget *widget,
if (GTK_WIDGET_REALIZED (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]); 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, ...@@ -13689,7 +13689,7 @@ gtk_tree_view_state_changed (GtkWidget *widget,
if (GTK_WIDGET_REALIZED (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]); gdk_window_set_background (tree_view->priv->bin_window, &widget->style->base[widget->state]);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment