user32: Update the window DPI awareness in SetParent().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
433788736b
commit
8a70b70f42
|
@ -3526,7 +3526,7 @@ static void test_dpi_window(void)
|
|||
DPI_AWARENESS_CONTEXT context, orig;
|
||||
DPI_AWARENESS awareness;
|
||||
ULONG_PTR i, j;
|
||||
HWND hwnd, child;
|
||||
HWND hwnd, child, ret;
|
||||
MSG msg = { 0, WM_USER + 1, 0, 0 };
|
||||
|
||||
if (!pGetWindowDpiAwarenessContext)
|
||||
|
@ -3556,6 +3556,22 @@ static void test_dpi_window(void)
|
|||
context = pGetWindowDpiAwarenessContext( child );
|
||||
awareness = pGetAwarenessFromDpiAwarenessContext( context );
|
||||
ok( awareness == i, "%lu/%lu: wrong awareness %u\n", i, j, awareness );
|
||||
ret = SetParent( child, NULL );
|
||||
ok( ret != 0, "SetParent failed err %u\n", GetLastError() );
|
||||
context = pGetWindowDpiAwarenessContext( child );
|
||||
awareness = pGetAwarenessFromDpiAwarenessContext( context );
|
||||
ok( awareness == i, "%lu/%lu: wrong awareness %u\n", i, j, awareness );
|
||||
DestroyWindow( child );
|
||||
child = CreateWindowA( "DpiTestClass", "Test",
|
||||
WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL );
|
||||
context = pGetWindowDpiAwarenessContext( child );
|
||||
awareness = pGetAwarenessFromDpiAwarenessContext( context );
|
||||
ok( awareness == j, "%lu/%lu: wrong awareness %u\n", i, j, awareness );
|
||||
ret = SetParent( child, hwnd );
|
||||
ok( ret != 0, "SetParent failed err %u\n", GetLastError() );
|
||||
context = pGetWindowDpiAwarenessContext( child );
|
||||
awareness = pGetAwarenessFromDpiAwarenessContext( context );
|
||||
ok( awareness == i, "%lu/%lu: wrong awareness %u\n", i, j, awareness );
|
||||
DestroyWindow( child );
|
||||
}
|
||||
DestroyWindow( hwnd );
|
||||
|
|
|
@ -3083,6 +3083,7 @@ HWND WINAPI SetParent( HWND hwnd, HWND parent )
|
|||
{
|
||||
old_parent = wine_server_ptr_handle( reply->old_parent );
|
||||
wndPtr->parent = parent = wine_server_ptr_handle( reply->full_parent );
|
||||
wndPtr->dpi_awareness = reply->awareness;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3571,6 +3571,8 @@ struct set_parent_reply
|
|||
struct reply_header __header;
|
||||
user_handle_t old_parent;
|
||||
user_handle_t full_parent;
|
||||
int awareness;
|
||||
char __pad_20[4];
|
||||
};
|
||||
|
||||
|
||||
|
@ -6507,6 +6509,6 @@ union generic_reply
|
|||
struct terminate_job_reply terminate_job_reply;
|
||||
};
|
||||
|
||||
#define SERVER_PROTOCOL_VERSION 549
|
||||
#define SERVER_PROTOCOL_VERSION 550
|
||||
|
||||
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
|
||||
|
|
|
@ -2564,6 +2564,7 @@ enum message_type
|
|||
@REPLY
|
||||
user_handle_t old_parent; /* old parent window */
|
||||
user_handle_t full_parent; /* full handle of new parent */
|
||||
int awareness; /* new DPI awareness */
|
||||
@END
|
||||
|
||||
|
||||
|
|
|
@ -1717,7 +1717,8 @@ C_ASSERT( FIELD_OFFSET(struct set_parent_request, parent) == 16 );
|
|||
C_ASSERT( sizeof(struct set_parent_request) == 24 );
|
||||
C_ASSERT( FIELD_OFFSET(struct set_parent_reply, old_parent) == 8 );
|
||||
C_ASSERT( FIELD_OFFSET(struct set_parent_reply, full_parent) == 12 );
|
||||
C_ASSERT( sizeof(struct set_parent_reply) == 16 );
|
||||
C_ASSERT( FIELD_OFFSET(struct set_parent_reply, awareness) == 16 );
|
||||
C_ASSERT( sizeof(struct set_parent_reply) == 24 );
|
||||
C_ASSERT( FIELD_OFFSET(struct get_window_parents_request, handle) == 12 );
|
||||
C_ASSERT( sizeof(struct get_window_parents_request) == 16 );
|
||||
C_ASSERT( FIELD_OFFSET(struct get_window_parents_reply, count) == 8 );
|
||||
|
|
|
@ -3131,6 +3131,7 @@ static void dump_set_parent_reply( const struct set_parent_reply *req )
|
|||
{
|
||||
fprintf( stderr, " old_parent=%08x", req->old_parent );
|
||||
fprintf( stderr, ", full_parent=%08x", req->full_parent );
|
||||
fprintf( stderr, ", awareness=%d", req->awareness );
|
||||
}
|
||||
|
||||
static void dump_get_window_parents_request( const struct get_window_parents_request *req )
|
||||
|
|
|
@ -250,6 +250,8 @@ static int set_parent_window( struct window *win, struct window *parent )
|
|||
win->parent = parent;
|
||||
link_window( win, WINPTR_TOP );
|
||||
|
||||
if (!is_desktop_window( parent )) win->dpi_awareness = parent->dpi_awareness;
|
||||
|
||||
/* if parent belongs to a different thread and the window isn't */
|
||||
/* top-level, attach the two threads */
|
||||
if (parent->thread && parent->thread != win->thread && !is_desktop_window(parent))
|
||||
|
@ -1939,6 +1941,7 @@ DECL_HANDLER(set_parent)
|
|||
reply->old_parent = win->parent->handle;
|
||||
reply->full_parent = parent ? parent->handle : 0;
|
||||
set_parent_window( win, parent );
|
||||
reply->awareness = win->dpi_awareness;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue