From 50dc5a30e1e9e20f4561fef0798b2d5a61485c91 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 26 May 2005 12:28:07 +0000 Subject: [PATCH] Crop the update region to the new window rectangle when resizing a window. --- server/window.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/server/window.c b/server/window.c index 750b2b3dc82..f1133bae2e5 100644 --- a/server/window.c +++ b/server/window.c @@ -1164,6 +1164,24 @@ static void set_window_pos( struct window *win, struct window *previous, goto done; } + /* crop update region to the new window rect */ + + if (win->update_region && + (window_rect->right - window_rect->left < old_window_rect.right - old_window_rect.left || + window_rect->bottom - window_rect->top < old_window_rect.bottom - old_window_rect.top)) + { + struct region *tmp = create_empty_region(); + if (tmp) + { + set_region_rect( tmp, window_rect ); + offset_region( tmp, -window_rect->left, -window_rect->top ); + if (intersect_region( tmp, win->update_region, tmp )) + set_update_region( win, tmp ); + else + free_region( tmp ); + } + } + if (swp_flags & SWP_NOREDRAW) goto done; /* do not repaint anything */ /* expose the whole non-client area if it changed in any way */