From bcbc84e21455e31dcac742d81d409581f451a506 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 20 Jul 2017 10:41:43 +0200 Subject: [PATCH] user32: Don't exclude clipped children from the copied window bits since they may be up to date. Signed-off-by: Alexandre Julliard --- dlls/user32/painting.c | 2 +- include/wine/server_protocol.h | 19 ++++++++++--------- server/protocol.def | 17 +++++++++-------- server/window.c | 3 +++ 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c index 844835505f2..2130473d39a 100644 --- a/dlls/user32/painting.c +++ b/dlls/user32/painting.c @@ -774,7 +774,7 @@ static void copy_bits_from_surface( HWND hwnd, struct window_surface *surface, char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; BITMAPINFO *info = (BITMAPINFO *)buffer; void *bits; - UINT flags = UPDATE_NOCHILDREN; + UINT flags = UPDATE_NOCHILDREN | UPDATE_CLIPCHILDREN; HRGN rgn = get_update_region( hwnd, &flags, NULL ); HDC hdc = GetDCEx( hwnd, rgn, DCX_CACHE | DCX_WINDOW | DCX_EXCLUDERGN ); diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 261391afd92..932a25c51f7 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -3748,14 +3748,15 @@ struct get_update_region_reply /* VARARG(region,rectangles); */ char __pad_20[4]; }; -#define UPDATE_NONCLIENT 0x01 -#define UPDATE_ERASE 0x02 -#define UPDATE_PAINT 0x04 -#define UPDATE_INTERNALPAINT 0x08 -#define UPDATE_ALLCHILDREN 0x10 -#define UPDATE_NOCHILDREN 0x20 -#define UPDATE_NOREGION 0x40 -#define UPDATE_DELAYED_ERASE 0x80 +#define UPDATE_NONCLIENT 0x001 +#define UPDATE_ERASE 0x002 +#define UPDATE_PAINT 0x004 +#define UPDATE_INTERNALPAINT 0x008 +#define UPDATE_ALLCHILDREN 0x010 +#define UPDATE_NOCHILDREN 0x020 +#define UPDATE_NOREGION 0x040 +#define UPDATE_DELAYED_ERASE 0x080 +#define UPDATE_CLIPCHILDREN 0x100 @@ -6419,6 +6420,6 @@ union generic_reply struct terminate_job_reply terminate_job_reply; }; -#define SERVER_PROTOCOL_VERSION 534 +#define SERVER_PROTOCOL_VERSION 535 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/protocol.def b/server/protocol.def index b834c8971a1..6a4d3fcb188 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2694,14 +2694,15 @@ enum coords_relative data_size_t total_size; /* total size of the resulting region */ VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */ @END -#define UPDATE_NONCLIENT 0x01 /* get region for repainting non-client area */ -#define UPDATE_ERASE 0x02 /* get region for erasing client area */ -#define UPDATE_PAINT 0x04 /* get region for painting client area */ -#define UPDATE_INTERNALPAINT 0x08 /* get region if internal paint is pending */ -#define UPDATE_ALLCHILDREN 0x10 /* force repaint of all children */ -#define UPDATE_NOCHILDREN 0x20 /* don't try to repaint any children */ -#define UPDATE_NOREGION 0x40 /* don't return a region, only the flags */ -#define UPDATE_DELAYED_ERASE 0x80 /* still needs erase after BeginPaint */ +#define UPDATE_NONCLIENT 0x001 /* get region for repainting non-client area */ +#define UPDATE_ERASE 0x002 /* get region for erasing client area */ +#define UPDATE_PAINT 0x004 /* get region for painting client area */ +#define UPDATE_INTERNALPAINT 0x008 /* get region if internal paint is pending */ +#define UPDATE_ALLCHILDREN 0x010 /* force repaint of all children */ +#define UPDATE_NOCHILDREN 0x020 /* don't try to repaint any children */ +#define UPDATE_NOREGION 0x040 /* don't return a region, only the flags */ +#define UPDATE_DELAYED_ERASE 0x080 /* still needs erase after BeginPaint */ +#define UPDATE_CLIPCHILDREN 0x100 /* remove clipped children from the update region */ /* Update the z order of a window so that a given rectangle is fully visible */ diff --git a/server/window.c b/server/window.c index 463c4f25dcc..2f2aae483d5 100644 --- a/server/window.c +++ b/server/window.c @@ -2587,6 +2587,9 @@ DECL_HANDLER(get_update_region) free_region( region ); return; } + if ((flags & UPDATE_CLIPCHILDREN) && (win->style & WS_CLIPCHILDREN)) + clip_children( win, NULL, region, win->client_rect.left - win->window_rect.left, + win->client_rect.top - win->window_rect.top ); map_win_region_to_screen( win, region ); if (!(data = get_region_data_and_free( region, get_reply_max_size(), &reply->total_size ))) return; -- 2.11.4.GIT