Ensure that we always calculate clip regions for root windows

Without this we can't draw to them, which caused problems for e.g.
gnome-settings-daemon clearing the background when the desktop
background changed.

Note: We don't actually clip away child windows from the root window,
the clip is just based on the size of the root window.
This commit is contained in:
Alexander Larsson 2009-06-25 16:59:18 +02:00
parent 794f2815de
commit 43bc999e6d
3 changed files with 10 additions and 4 deletions

View File

@ -774,7 +774,8 @@ recompute_visible_regions_internal (GdkWindowObject *private,
old_clip_region_with_children = private->clip_region_with_children;
private->clip_region_with_children = gdk_region_copy (private->clip_region);
remove_child_area (private, NULL, FALSE, private->clip_region_with_children);
if (GDK_WINDOW_TYPE (private) != GDK_WINDOW_ROOT)
remove_child_area (private, NULL, FALSE, private->clip_region_with_children);
if (clip_region_changed ||
!gdk_region_equal (private->clip_region_with_children, old_clip_region_with_children))
@ -817,8 +818,9 @@ recompute_visible_regions_internal (GdkWindowObject *private,
}
}
/* Update all children, recursively. */
if (abs_pos_changed || clip_region_changed || recalculate_children)
/* Update all children, recursively (except for root, where children are not exact). */
if ((abs_pos_changed || clip_region_changed || recalculate_children) &&
GDK_WINDOW_TYPE (private) != GDK_WINDOW_ROOT)
{
for (l = private->children; l; l = l->next)
{
@ -840,7 +842,9 @@ recompute_visible_regions_internal (GdkWindowObject *private,
(private->parent != NULL &&
GDK_WINDOW_TYPE (private->parent) != GDK_WINDOW_ROOT)) &&
/* or for foreign windows */
GDK_WINDOW_TYPE (private) != GDK_WINDOW_FOREIGN
GDK_WINDOW_TYPE (private) != GDK_WINDOW_FOREIGN &&
/* or for the root window */
GDK_WINDOW_TYPE (private) != GDK_WINDOW_ROOT
)
{
GDK_WINDOW_IMPL_GET_IFACE (private->impl)->shape_combine_region ((GdkWindow *)private, private->clip_region, 0, 0);

View File

@ -1835,6 +1835,7 @@ gdk_event_translate (GdkDisplay *display,
window_private->width = xevent->xconfigure.width;
window_private->height = xevent->xconfigure.height;
_gdk_window_update_size (window);
_gdk_x11_drawable_update_size (window_private->impl);
_gdk_x11_screen_size_changed (screen, xevent);
}

View File

@ -450,6 +450,7 @@ _gdk_windowing_window_init (GdkScreen * screen)
private->abs_y = 0;
private->width = WidthOfScreen (screen_x11->xscreen);
private->height = HeightOfScreen (screen_x11->xscreen);
_gdk_window_update_size (screen_x11->root_window);
_gdk_xid_table_insert (screen_x11->display,
&screen_x11->xroot_window,