From 4f88a57ce72d72ca17a9b281f4cfefaa86729e39 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 13 Jul 2017 10:59:38 +0200 Subject: [PATCH] server: Return the top surface window even when not using OpenGL. Signed-off-by: Alexandre Julliard --- dlls/user32/winpos.c | 5 +++-- include/wine/server_protocol.h | 4 ++-- server/protocol.def | 3 ++- server/request.h | 1 + server/trace.c | 1 + server/window.c | 7 ++++--- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index a9f3d9e2638..87f8deb4263 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -2059,7 +2059,7 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, { WND *win; HWND surface_win = 0, parent = GetAncestor( hwnd, GA_PARENT ); - BOOL ret; + BOOL ret, needs_update = FALSE; int old_width; RECT visible_rect, old_visible_rect, old_window_rect; struct window_surface *old_surface, *new_surface = NULL; @@ -2116,6 +2116,7 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, win->visible_rect = visible_rect; win->surface = new_surface; surface_win = wine_server_ptr_handle( reply->surface_win ); + needs_update = reply->needs_update; if (GetWindowLongW( win->parent, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) { RECT client; @@ -2133,7 +2134,7 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, if (ret) { - if (surface_win) update_surface_region( surface_win ); + if (needs_update) update_surface_region( surface_win ); if (((swp_flags & SWP_AGG_NOPOSCHANGE) != SWP_AGG_NOPOSCHANGE) || (swp_flags & (SWP_HIDEWINDOW | SWP_SHOWWINDOW | SWP_STATECHANGED | SWP_FRAMECHANGED))) invalidate_dce( win, &old_window_rect ); diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index d31579c8800..261391afd92 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -3591,7 +3591,7 @@ struct set_window_pos_reply unsigned int new_style; unsigned int new_ex_style; user_handle_t surface_win; - char __pad_20[4]; + int needs_update; }; #define SET_WINPOS_PAINT_SURFACE 0x01 #define SET_WINPOS_PIXEL_FORMAT 0x02 @@ -6419,6 +6419,6 @@ union generic_reply struct terminate_job_reply terminate_job_reply; }; -#define SERVER_PROTOCOL_VERSION 533 +#define SERVER_PROTOCOL_VERSION 534 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/protocol.def b/server/protocol.def index 1f88c6a5c86..b834c8971a1 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2592,7 +2592,8 @@ enum message_type @REPLY unsigned int new_style; /* new window style */ unsigned int new_ex_style; /* new window extended style */ - user_handle_t surface_win; /* window that needs a surface update */ + user_handle_t surface_win; /* parent window that holds the surface */ + int needs_update; /* whether the surface region needs an update */ @END #define SET_WINPOS_PAINT_SURFACE 0x01 /* window has a paintable surface */ #define SET_WINPOS_PIXEL_FORMAT 0x02 /* window has a custom pixel format */ diff --git a/server/request.h b/server/request.h index 30d2234104d..f76f668caee 100644 --- a/server/request.h +++ b/server/request.h @@ -1726,6 +1726,7 @@ C_ASSERT( sizeof(struct set_window_pos_request) == 56 ); C_ASSERT( FIELD_OFFSET(struct set_window_pos_reply, new_style) == 8 ); C_ASSERT( FIELD_OFFSET(struct set_window_pos_reply, new_ex_style) == 12 ); C_ASSERT( FIELD_OFFSET(struct set_window_pos_reply, surface_win) == 16 ); +C_ASSERT( FIELD_OFFSET(struct set_window_pos_reply, needs_update) == 20 ); C_ASSERT( sizeof(struct set_window_pos_reply) == 24 ); C_ASSERT( FIELD_OFFSET(struct get_window_rectangles_request, handle) == 12 ); C_ASSERT( FIELD_OFFSET(struct get_window_rectangles_request, relative) == 16 ); diff --git a/server/trace.c b/server/trace.c index 7a4b4b25dd6..ac0f8b01b0d 100644 --- a/server/trace.c +++ b/server/trace.c @@ -3146,6 +3146,7 @@ static void dump_set_window_pos_reply( const struct set_window_pos_reply *req ) fprintf( stderr, " new_style=%08x", req->new_style ); fprintf( stderr, ", new_ex_style=%08x", req->new_ex_style ); fprintf( stderr, ", surface_win=%08x", req->surface_win ); + fprintf( stderr, ", needs_update=%d", req->needs_update ); } static void dump_get_window_rectangles_request( const struct get_window_rectangles_request *req ) diff --git a/server/window.c b/server/window.c index f35d6f60a42..463c4f25dcc 100644 --- a/server/window.c +++ b/server/window.c @@ -2298,10 +2298,11 @@ DECL_HANDLER(set_window_pos) reply->new_ex_style = win->ex_style; top = get_top_clipping_window( win ); - if (is_visible( top ) && - (top->paint_flags & PAINT_HAS_SURFACE) && - (top->paint_flags & (PAINT_HAS_PIXEL_FORMAT | PAINT_PIXEL_FORMAT_CHILD))) + if (is_visible( top ) && (top->paint_flags & PAINT_HAS_SURFACE)) + { reply->surface_win = top->handle; + reply->needs_update = !!(top->paint_flags & (PAINT_HAS_PIXEL_FORMAT | PAINT_PIXEL_FORMAT_CHILD)); + } } -- 2.11.4.GIT