server: Return the top surface window even when not using OpenGL.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-07-13 10:59:38 +02:00
parent a826fb6f0a
commit 4f88a57ce7
6 changed files with 13 additions and 8 deletions

View File

@ -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 );

View File

@ -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 */

View File

@ -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 */

View File

@ -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 );

View File

@ -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 )

View File

@ -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));
}
}