From ccfd33c5a5d739c1ba78b526f58b1486e0748519 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Tue, 19 Aug 2003 18:32:12 +0000 Subject: [PATCH] Don't use impl->position_info.clip_rect for toplevels. (#107068, reported Tue Aug 19 13:58:50 2003 Owen Taylor * gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): Don't use impl->position_info.clip_rect for toplevels. (#107068, reported by Thomas Mirlacher) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gdk/x11/gdkgeometry-x11.c | 19 +++++++++++++++---- 6 files changed, 45 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 893653944b..f5972d2139 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Aug 19 13:58:50 2003 Owen Taylor + + * gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): + Don't use impl->position_info.clip_rect for toplevels. + (#107068, reported by Thomas Mirlacher) + Mon Aug 18 11:48:51 2003 Owen Taylor * gdk/x11/gdkdrawable-x11.c (convert_to_format): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 893653944b..f5972d2139 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Tue Aug 19 13:58:50 2003 Owen Taylor + + * gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): + Don't use impl->position_info.clip_rect for toplevels. + (#107068, reported by Thomas Mirlacher) + Mon Aug 18 11:48:51 2003 Owen Taylor * gdk/x11/gdkdrawable-x11.c (convert_to_format): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 893653944b..f5972d2139 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Tue Aug 19 13:58:50 2003 Owen Taylor + + * gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): + Don't use impl->position_info.clip_rect for toplevels. + (#107068, reported by Thomas Mirlacher) + Mon Aug 18 11:48:51 2003 Owen Taylor * gdk/x11/gdkdrawable-x11.c (convert_to_format): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 893653944b..f5972d2139 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Tue Aug 19 13:58:50 2003 Owen Taylor + + * gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): + Don't use impl->position_info.clip_rect for toplevels. + (#107068, reported by Thomas Mirlacher) + Mon Aug 18 11:48:51 2003 Owen Taylor * gdk/x11/gdkdrawable-x11.c (convert_to_format): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 893653944b..f5972d2139 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Tue Aug 19 13:58:50 2003 Owen Taylor + + * gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): + Don't use impl->position_info.clip_rect for toplevels. + (#107068, reported by Thomas Mirlacher) + Mon Aug 18 11:48:51 2003 Owen Taylor * gdk/x11/gdkdrawable-x11.c (convert_to_format): diff --git a/gdk/x11/gdkgeometry-x11.c b/gdk/x11/gdkgeometry-x11.c index 693a0cc51b..16480277d0 100644 --- a/gdk/x11/gdkgeometry-x11.c +++ b/gdk/x11/gdkgeometry-x11.c @@ -402,7 +402,7 @@ gdk_window_scroll (GdkWindow *window, GdkRegion *invalidate_region; GdkWindowImplX11 *impl; GdkWindowObject *obj; - GdkRectangle dest_rect; + GdkRectangle src_rect, dest_rect; g_return_if_fail (GDK_IS_WINDOW (window)); @@ -419,12 +419,23 @@ gdk_window_scroll (GdkWindow *window, if (obj->update_area) gdk_region_offset (obj->update_area, dx, dy); - invalidate_region = gdk_region_rectangle (&impl->position_info.clip_rect); + /* impl->position_info.clip_rect isn't meaningful for toplevels */ + if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD) + src_rect = impl->position_info.clip_rect; + else + { + src_rect.x = 0; + src_rect.y = 0; + src_rect.width = impl->width; + src_rect.height = impl->height; + } - dest_rect = impl->position_info.clip_rect; + invalidate_region = gdk_region_rectangle (&src_rect); + + dest_rect = src_rect; dest_rect.x += dx; dest_rect.y += dy; - gdk_rectangle_intersect (&dest_rect, &impl->position_info.clip_rect, &dest_rect); + gdk_rectangle_intersect (&dest_rect, &src_rect, &dest_rect); if (dest_rect.width > 0 && dest_rect.height > 0) {