From 43bc999e6d68b1be8607c42baacdb0fd0fade3f4 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 25 Jun 2009 16:59:18 +0200 Subject: [PATCH] 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. --- gdk/gdkwindow.c | 12 ++++++++---- gdk/x11/gdkevents-x11.c | 1 + gdk/x11/gdkwindow-x11.c | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index aa10712621..c60ca61858 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -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); diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c index 4565b3961b..ad5107bdd6 100644 --- a/gdk/x11/gdkevents-x11.c +++ b/gdk/x11/gdkevents-x11.c @@ -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); } diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 303b18aa27..9caa17a163 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -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,