[PATCH v2 0/3] MR11592: server: Don't change DPI awareness context when reparenting.
-- v2: server: Don't change DPI awareness context when reparenting. server: Check DPI awareness contexts when reparenting windows. user32/tests: Improve reparenting tests with different DPI awareness. https://gitlab.winehq.org/wine/wine/-/merge_requests/11592
From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/user32/tests/monitor.c | 42 +++++++++++++++++++++++++++-------- dlls/user32/tests/sysparams.c | 9 ++++++-- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index 8f82b328653..de0b73dfb42 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -3260,7 +3260,7 @@ static void test_monitor_dpi_awareness( const struct monitor_info *infos, UINT c RECT primary = {0}, scaled_device = {0}, expect_device = {0}, rect, expect_rect, device; struct monitor_info tmp_info = {.handle = info->handle}; UINT ret, i, x, y, expect_width, expect_height; - HWND unaware_hwnd, aware_hwnd, primary_hwnd, child; + HWND unaware_hwnd, aware_hwnd, primary_hwnd, child, hwnd; MONITORINFO mi = {.cbSize = sizeof(mi)}; DPI_AWARENESS_CONTEXT old_ctx = 0, cur_ctx, ctx, system_ctx = (DPI_AWARENESS_CONTEXT)(((UINT_PTR)system_dpi << 8)|0x11); float unaware_scale = scales[step], scale, scale_x, scale_y; @@ -3558,7 +3558,8 @@ static void test_monitor_dpi_awareness( const struct monitor_info *infos, UINT c ret = pGetDpiForWindow( child ); ok( ret == system_dpi, "GetDpiForWindow returned %u\n", ret ); - SetParent( child, NULL ); + hwnd = SetParent( child, NULL ); + ok( hwnd == unaware_hwnd, "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); flush_events(); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); @@ -3568,7 +3569,15 @@ static void test_monitor_dpi_awareness( const struct monitor_info *infos, UINT c ret = pGetDpiForWindow( child ); ok( ret == system_dpi, "GetDpiForWindow returned %u\n", ret ); - SetParent( child, aware_hwnd ); + SetLastError( 0xdeadbeef ); + hwnd = SetParent( child, aware_hwnd ); + if (system_aware && !monitor_aware) ok( hwnd == GetDesktopWindow(), "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); + else if (!tests[i]) ok( hwnd == GetDesktopWindow(), "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); + else + { + todo_wine ok( hwnd == NULL, "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); + todo_wine ok( GetLastError() == ERROR_INVALID_STATE, "SetParent failed err %lu\n", GetLastError() ); + } ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); flush_events(); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); @@ -3579,7 +3588,9 @@ static void test_monitor_dpi_awareness( const struct monitor_info *infos, UINT c ret = pGetDpiForWindow( child ); ok( ret == system_dpi, "GetDpiForWindow returned %u\n", ret ); - SetParent( child, NULL ); + hwnd = SetParent( child, NULL ); + if (system_aware && !monitor_aware) ok( hwnd == aware_hwnd, "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); + else todo_wine ok( hwnd == GetDesktopWindow(), "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); flush_events(); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); @@ -3610,7 +3621,8 @@ static void test_monitor_dpi_awareness( const struct monitor_info *infos, UINT c /* WM_DPICHANGED is only sent if window was child of monitor aware window, and if * reparenting makes the window toplevel and changes its monitor */ - SetParent( child, NULL ); + hwnd = SetParent( child, NULL ); + ok( hwnd == aware_hwnd, "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); same_monitor = MonitorFromWindow( aware_hwnd, MONITOR_DEFAULTTONEAREST ) == MonitorFromWindow( child, MONITOR_DEFAULTTONEAREST ); if (!monitor_aware || same_monitor) ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); else @@ -3631,7 +3643,15 @@ static void test_monitor_dpi_awareness( const struct monitor_info *infos, UINT c if (monitor_aware && same_monitor) ok( ret == MulDiv( system_dpi, scale, 100 ), "GetDpiForWindow returned %u\n", ret ); else ok( ret == (system_aware ? system_dpi : 96), "GetDpiForWindow returned %u\n", ret ); - SetParent( child, unaware_hwnd ); + SetLastError( 0xdeadbeef ); + hwnd = SetParent( child, unaware_hwnd ); + if (system_aware && !monitor_aware) ok( hwnd == GetDesktopWindow(), "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); + else if (!tests[i]) ok( hwnd == GetDesktopWindow(), "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); + else + { + todo_wine ok( hwnd == NULL, "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); + todo_wine ok( GetLastError() == ERROR_INVALID_STATE, "SetParent failed err %lu\n", GetLastError() ); + } ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); flush_events(); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); @@ -3645,7 +3665,9 @@ static void test_monitor_dpi_awareness( const struct monitor_info *infos, UINT c /* WM_DPICHANGED is only sent if window was child of monitor aware window, and if * reparenting makes the window toplevel and changes its monitor */ - SetParent( child, NULL ); + hwnd = SetParent( child, NULL ); + if (system_aware && !monitor_aware) ok( hwnd == unaware_hwnd, "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); + else todo_wine ok( hwnd == GetDesktopWindow(), "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); flush_events(); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); @@ -3657,7 +3679,8 @@ static void test_monitor_dpi_awareness( const struct monitor_info *infos, UINT c if (monitor_aware && same_monitor) ok( ret == MulDiv( system_dpi, scale, 100 ), "GetDpiForWindow returned %u\n", ret ); else ok( ret == (system_aware ? system_dpi : 96), "GetDpiForWindow returned %u\n", ret ); - SetParent( child, aware_hwnd ); + hwnd = SetParent( child, aware_hwnd ); + ok( hwnd == GetDesktopWindow(), "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); flush_events(); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); @@ -3671,7 +3694,8 @@ static void test_monitor_dpi_awareness( const struct monitor_info *infos, UINT c /* WM_DPICHANGED is only sent if window was children of monitor aware window, and if * reparenting makes the window toplevel and changes its monitor */ - SetParent( child, NULL ); + hwnd = SetParent( child, NULL ); + ok( hwnd == aware_hwnd, "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); same_monitor = MonitorFromWindow( aware_hwnd, MONITOR_DEFAULTTONEAREST ) == MonitorFromWindow( child, MONITOR_DEFAULTTONEAREST ); if (!monitor_aware || same_monitor) ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); else diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index 6c973e38a08..31b125ae1d0 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -4591,9 +4591,14 @@ static void test_dpi_window(void) dpi = pGetDpiForWindow( child ); ok( dpi == (j == DPI_AWARENESS_UNAWARE ? USER_DEFAULT_SCREEN_DPI : real_dpi), "%Iu/%Iu: got %u / %u\n", i, j, dpi, real_dpi ); + SetLastError( 0xdeadbeef ); ret = SetParent( child, hwnd ); - ok( ret != 0 || GetLastError() == ERROR_INVALID_STATE, - "SetParent failed err %lu\n", GetLastError() ); + if (i == j) ok( !!ret, "SetParent failed err %lu\n", GetLastError() ); + else + { + todo_wine ok( !ret, "SetParent succeeded\n" ); + todo_wine ok( GetLastError() == ERROR_INVALID_STATE, "SetParent failed err %lu\n", GetLastError() ); + } context = pGetWindowDpiAwarenessContext( child ); awareness = pGetAwarenessFromDpiAwarenessContext( context ); ok( awareness == (ret ? i : j), "%Iu/%Iu: wrong awareness %u\n", i, j, awareness ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11592
From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/user32/tests/monitor.c | 18 ++++++++---------- dlls/user32/tests/sysparams.c | 4 ++-- server/window.c | 11 +++++++++++ 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index de0b73dfb42..550108f720c 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -3575,28 +3575,26 @@ static void test_monitor_dpi_awareness( const struct monitor_info *infos, UINT c else if (!tests[i]) ok( hwnd == GetDesktopWindow(), "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); else { - todo_wine ok( hwnd == NULL, "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); - todo_wine ok( GetLastError() == ERROR_INVALID_STATE, "SetParent failed err %lu\n", GetLastError() ); + ok( hwnd == NULL, "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); + ok( GetLastError() == ERROR_INVALID_STATE, "SetParent failed err %lu\n", GetLastError() ); } ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); flush_events(); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); ctx = pGetWindowDpiAwarenessContext( child ); - todo_wine_if( tests[i] && tests[i] != DPI_AWARENESS_CONTEXT_SYSTEM_AWARE && tests[i] != (DPI_AWARENESS_CONTEXT)0x7811 ) ok( ctx == system_ctx, "GetWindowDpiAwarenessContext returned %#Ix\n", (UINT_PTR)ctx ); ret = pGetDpiForWindow( child ); ok( ret == system_dpi, "GetDpiForWindow returned %u\n", ret ); hwnd = SetParent( child, NULL ); if (system_aware && !monitor_aware) ok( hwnd == aware_hwnd, "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); - else todo_wine ok( hwnd == GetDesktopWindow(), "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); + else ok( hwnd == GetDesktopWindow(), "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); flush_events(); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); ctx = pGetWindowDpiAwarenessContext( child ); - todo_wine_if( tests[i] && tests[i] != DPI_AWARENESS_CONTEXT_SYSTEM_AWARE && tests[i] != (DPI_AWARENESS_CONTEXT)0x7811 ) ok( ctx == system_ctx, "GetWindowDpiAwarenessContext returned %#Ix\n", (UINT_PTR)ctx ); ret = pGetDpiForWindow( child ); ok( ret == system_dpi, "GetDpiForWindow returned %u\n", ret ); @@ -3649,15 +3647,15 @@ static void test_monitor_dpi_awareness( const struct monitor_info *infos, UINT c else if (!tests[i]) ok( hwnd == GetDesktopWindow(), "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); else { - todo_wine ok( hwnd == NULL, "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); - todo_wine ok( GetLastError() == ERROR_INVALID_STATE, "SetParent failed err %lu\n", GetLastError() ); + ok( hwnd == NULL, "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); + ok( GetLastError() == ERROR_INVALID_STATE, "SetParent failed err %lu\n", GetLastError() ); } ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); flush_events(); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); ctx = pGetWindowDpiAwarenessContext( child ); - todo_wine_if( tests[i] && tests[i] != DPI_AWARENESS_CONTEXT_SYSTEM_AWARE && tests[i] != (DPI_AWARENESS_CONTEXT)0x7811 ) + todo_wine_if( tests[i] == DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ) ok( ctx == cur_ctx, "GetWindowDpiAwarenessContext returned %p vs %p\n", ctx, cur_ctx ); ret = pGetDpiForWindow( child ); if (monitor_aware && same_monitor) ok( ret == MulDiv( system_dpi, scale, 100 ), "GetDpiForWindow returned %u\n", ret ); @@ -3667,13 +3665,13 @@ static void test_monitor_dpi_awareness( const struct monitor_info *infos, UINT c * reparenting makes the window toplevel and changes its monitor */ hwnd = SetParent( child, NULL ); if (system_aware && !monitor_aware) ok( hwnd == unaware_hwnd, "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); - else todo_wine ok( hwnd == GetDesktopWindow(), "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); + else ok( hwnd == GetDesktopWindow(), "SetParent returned %p, error %lu\n", hwnd, GetLastError() ); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); flush_events(); ok( dpichanged_count == 0, "got dpichanged_count %u\n", dpichanged_count ); ctx = pGetWindowDpiAwarenessContext( child ); - todo_wine_if( tests[i] && tests[i] != DPI_AWARENESS_CONTEXT_SYSTEM_AWARE && tests[i] != (DPI_AWARENESS_CONTEXT)0x7811 ) + todo_wine_if( tests[i] == DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ) ok( ctx == cur_ctx, "GetWindowDpiAwarenessContext returned %p vs %p\n", ctx, cur_ctx ); ret = pGetDpiForWindow( child ); if (monitor_aware && same_monitor) ok( ret == MulDiv( system_dpi, scale, 100 ), "GetDpiForWindow returned %u\n", ret ); diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index 31b125ae1d0..1c296448265 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -4596,8 +4596,8 @@ static void test_dpi_window(void) if (i == j) ok( !!ret, "SetParent failed err %lu\n", GetLastError() ); else { - todo_wine ok( !ret, "SetParent succeeded\n" ); - todo_wine ok( GetLastError() == ERROR_INVALID_STATE, "SetParent failed err %lu\n", GetLastError() ); + ok( !ret, "SetParent succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_STATE, "SetParent failed err %lu\n", GetLastError() ); } context = pGetWindowDpiAwarenessContext( child ); awareness = pGetAwarenessFromDpiAwarenessContext( context ); diff --git a/server/window.c b/server/window.c index 88f906cb746..b97eb2aa1c4 100644 --- a/server/window.c +++ b/server/window.c @@ -2118,6 +2118,13 @@ static void set_window_region( struct window *win, struct region *region, int re clear_error(); /* we ignore out of memory errors since the region has been set */ } +/* check if DPI awareness contexts are compatible */ +static bool is_dpi_awareness_compatible( struct window *win, struct window *other ) +{ + unsigned int awareness = NTUSER_DPI_CONTEXT_GET_AWARENESS( win->shared->dpi_context ); + return awareness == NTUSER_DPI_CONTEXT_GET_AWARENESS( other->shared->dpi_context ); +} + /* destroy a window */ void free_window_handle( struct window *win ) @@ -2303,6 +2310,10 @@ DECL_HANDLER(set_parent) if (!(win = get_window( req->handle ))) return; if (req->parent && !(parent = get_window( req->parent ))) return; + /* reparenting to a window with a different DPI awareness isn't allowed */ + if (parent && !is_desktop_window( parent ) && !is_dpi_awareness_compatible( win, parent )) + return set_error( STATUS_INVALID_STATE_TRANSITION ); + if (is_desktop_window(win) || is_orphan_window( win ) || (parent && is_orphan_window( parent ))) { set_error( STATUS_INVALID_PARAMETER ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11592
From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/win32u/window.c | 6 ++++++ server/window.c | 34 +++++++++++++++++----------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index f85e5b193a0..10e95943c9c 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5675,6 +5675,12 @@ static WND *create_window_handle( HWND parent, HWND owner, UNICODE_STRING *name, struct ratio dpi, raw_dpi; WND *win; + if (NTUSER_DPI_CONTEXT_IS_MONITOR_AWARE( dpi_context ) && dpi_context != NTUSER_DPI_PER_MONITOR_AWARE) + { + FIXME( "DPI context %#x not implemented\n", dpi_context ); + dpi_context = NTUSER_DPI_PER_MONITOR_AWARE; + } + if (parent && parent != get_desktop_window()) dpi = get_win_monitor_dpi( parent, &raw_dpi ); else dpi = monitor_dpi_from_rect( rect, get_thread_dpi(), &raw_dpi ); diff --git a/server/window.c b/server/window.c index b97eb2aa1c4..908a8a224bd 100644 --- a/server/window.c +++ b/server/window.c @@ -174,6 +174,12 @@ static inline int is_desktop_window( const struct window *win ) return !win->parent; /* only desktop windows have no parent */ } +/* check if window is a toplevel or desktop window */ +static bool is_toplevel( const struct window *win ) +{ + return !win->parent || is_desktop_window( win->parent ); +} + /* check if window is orphaned */ static int is_orphan_window( struct window *win ) { @@ -305,7 +311,7 @@ static void map_point_raw_to_virt( struct desktop *desktop, int *x, int *y ) /* get the per-monitor DPI for a window */ static struct ratio get_monitor_dpi( struct window *win ) { - while (win->parent && !is_desktop_window( win->parent )) win = win->parent; + while (!is_toplevel( win )) win = win->parent; return win->shared->dpi; } @@ -414,7 +420,6 @@ static int set_parent_window( struct window *win, struct window *parent ) if (is_desktop_window( parent )) set_window_monitor_dpi( win ); else SHARED_WRITE_BEGIN( win->shared, window_shm_t ) { - shared->dpi_context = parent->shared->dpi_context; shared->dpi = parent->shared->dpi; shared->raw_dpi = parent->shared->raw_dpi; } @@ -604,8 +609,8 @@ void post_desktop_message( struct desktop *desktop, unsigned int message, /* create a new window structure (note: the window is not linked in the window tree) */ static struct window *create_window( struct window *parent, struct window *owner, atom_t atom, - mod_handle_t class_instance, bool ansi, struct ratio dpi, - struct ratio raw_dpi ) + mod_handle_t class_instance, bool ansi, unsigned int dpi_context, + struct ratio dpi, struct ratio raw_dpi ) { data_size_t extra_size, private_size; struct window *win = NULL; @@ -674,8 +679,7 @@ static struct window *create_window( struct window *parent, struct window *owner SHARED_WRITE_BEGIN( win->shared, window_shm_t ) { shared->class = class_locator; - /* FIXME: NTUSER_DPI_PER_MONITOR_AWARE_V2 isn't implemented */ - shared->dpi_context = NTUSER_DPI_PER_MONITOR_AWARE; + shared->dpi_context = is_toplevel( win ) ? dpi_context : parent->shared->dpi_context; shared->fnid = fnid; shared->private_size = private_size; shared->dpi = dpi; @@ -1897,7 +1901,7 @@ static struct region *expose_window( struct window *win, const struct rectangle } } - if (win->parent && !is_desktop_window( win->parent )) + if (!is_toplevel( win )) { /* make it relative to the old window pos for subtracting */ offset_region( new_vis_rgn, win->window_rect.left - old_window_rect->left, @@ -1950,7 +1954,7 @@ static void set_window_pos( struct window *win, struct window *previous, else if (swp_flags & SWP_HIDEWINDOW) win->style &= ~WS_VISIBLE; /* update window monitor dpi for toplevel windows */ - if (!win->parent || is_desktop_window( win->parent )) set_window_monitor_dpi( win ); + if (is_toplevel( win )) set_window_monitor_dpi( win ); /* keep children at the same position relative to top right corner when the parent is mirrored */ if (win->ex_style & WS_EX_LAYOUTRTL) @@ -2217,7 +2221,6 @@ DECL_HANDLER(create_window) struct window *win, *parent = NULL, *owner = NULL; struct unicode_str cls_name = get_req_unicode_str(); struct atom_table *table = get_user_atom_table(); - unsigned int dpi_context = req->dpi_context; atom_t atom = req->atom; reply->handle = 0; @@ -2248,18 +2251,15 @@ DECL_HANDLER(create_window) if (!atom) atom = find_atom( table, cls_name ); - if (!(win = create_window( parent, owner, atom, req->class_instance, !!req->ansi, req->dpi, req->raw_dpi ))) return; - - /* FIXME: NTUSER_DPI_PER_MONITOR_AWARE_V2 isn't implemented */ - if (NTUSER_DPI_CONTEXT_IS_MONITOR_AWARE( dpi_context )) dpi_context = NTUSER_DPI_PER_MONITOR_AWARE; + if (!(win = create_window( parent, owner, atom, req->class_instance, !!req->ansi, + req->dpi_context, req->dpi, req->raw_dpi ))) + return; SHARED_WRITE_BEGIN( win->shared, window_shm_t ) { - shared->dpi_context = dpi_context; shared->info.instance = req->instance; if (parent && !is_desktop_window( parent )) { - shared->dpi_context = parent->shared->dpi_context; shared->dpi = parent->shared->dpi; shared->raw_dpi = parent->shared->raw_dpi; } @@ -2357,7 +2357,7 @@ DECL_HANDLER(get_desktop_window) if (!desktop->top_window && req->force) /* create it */ { if (!(info = get_monitor_from_rect( desktop->winstation, &desktop_rect, false ))) info = &default_info; - if ((desktop->top_window = create_window( NULL, NULL, DESKTOP_ATOM, 0, false, info->dpi, info->raw_dpi ))) + if ((desktop->top_window = create_window( NULL, NULL, DESKTOP_ATOM, 0, false, NTUSER_DPI_PER_MONITOR_AWARE, info->dpi, info->raw_dpi ))) { detach_window_thread( desktop->top_window ); desktop->top_window->style = WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; @@ -2372,7 +2372,7 @@ DECL_HANDLER(get_desktop_window) atom_t atom = add_atom( table, name ); if (!info && !(info = get_monitor_from_rect( desktop->winstation, &desktop_rect, false ))) info = &default_info; - if (atom && (desktop->msg_window = create_window( NULL, NULL, atom, 0, false, info->dpi, info->raw_dpi ))) + if (atom && (desktop->msg_window = create_window( NULL, NULL, atom, 0, false, NTUSER_DPI_PER_MONITOR_AWARE, info->dpi, info->raw_dpi ))) { detach_window_thread( desktop->msg_window ); desktop->msg_window->style = WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11592
v2: Add more tests showing that window cannot be reparented to a window with incompatible DPI awareness context, and implement that. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11592#note_148749
participants (2)
-
Rémi Bernon -
Rémi Bernon (@rbernon)