From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/input.c | 14 ++++----- dlls/win32u/sysparams.c | 22 +++++++++----- dlls/win32u/win32u_private.h | 4 +-- dlls/win32u/window.c | 41 +++++++++++++++----------- dlls/wineandroid.drv/init.c | 2 +- dlls/wineandroid.drv/window.c | 4 +-- dlls/winemac.drv/window.c | 6 ++-- dlls/winewayland.drv/wayland_surface.c | 4 +-- dlls/winewayland.drv/window.c | 2 +- dlls/winex11.drv/event.c | 4 +-- dlls/winex11.drv/init.c | 2 +- dlls/winex11.drv/opengl.c | 4 +-- dlls/winex11.drv/vulkan.c | 4 +-- dlls/winex11.drv/window.c | 2 +- include/ntuser.h | 4 +-- 15 files changed, 65 insertions(+), 54 deletions(-)
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 84f8aba1728..6328698f75f 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -709,9 +709,9 @@ BOOL WINAPI NtUserSetCursorPos( INT x, INT y ) RECT rect = {x, y, x, y}; BOOL ret; INT prev_x, prev_y, new_x, new_y; - UINT dpi; + UINT dpi, raw_dpi;
- dpi = monitor_dpi_from_rect( rect, get_thread_dpi() ); + dpi = monitor_dpi_from_rect( rect, get_thread_dpi(), &raw_dpi ); rect = map_dpi_rect( rect, get_thread_dpi(), dpi );
SERVER_START_REQ( set_cursor ) @@ -743,7 +743,7 @@ BOOL get_cursor_pos( POINT *pt ) DWORD last_change = 0; NTSTATUS status; RECT rect; - UINT dpi; + UINT dpi, raw_dpi;
if (!pt) return FALSE;
@@ -760,7 +760,7 @@ BOOL get_cursor_pos( POINT *pt ) if (!ret) return FALSE;
SetRect( &rect, pt->x, pt->y, pt->x, pt->y ); - dpi = monitor_dpi_from_rect( rect, get_thread_dpi() ); + dpi = monitor_dpi_from_rect( rect, get_thread_dpi(), &raw_dpi ); rect = map_dpi_rect( rect, dpi, get_thread_dpi() ); *pt = *(POINT *)&rect.left; return ret; @@ -2623,7 +2623,7 @@ BOOL get_clip_cursor( RECT *rect, UINT dpi ) if (!status) { UINT ctx = set_thread_dpi_awareness_context( NTUSER_DPI_PER_MONITOR_AWARE ); - UINT dpi_from = monitor_dpi_from_rect( *rect, get_thread_dpi() ); + UINT raw_dpi, dpi_from = monitor_dpi_from_rect( *rect, get_thread_dpi(), &raw_dpi ); *rect = map_dpi_rect( *rect, dpi_from, dpi ); set_thread_dpi_awareness_context( ctx ); } @@ -2671,7 +2671,7 @@ BOOL process_wine_clipcursor( HWND hwnd, UINT flags, BOOL reset ) */ BOOL WINAPI NtUserClipCursor( const RECT *rect ) { - UINT dpi_from = get_thread_dpi(), dpi_to; + UINT dpi_from = get_thread_dpi(), dpi_to, raw_dpi; BOOL ret; RECT new_rect;
@@ -2680,7 +2680,7 @@ BOOL WINAPI NtUserClipCursor( const RECT *rect ) if (rect) { if (rect->left > rect->right || rect->top > rect->bottom) return FALSE; - dpi_to = monitor_dpi_from_rect( *rect, dpi_from ); + dpi_to = monitor_dpi_from_rect( *rect, dpi_from, &raw_dpi ); new_rect = map_dpi_rect( *rect, dpi_from, dpi_to ); rect = &new_rect; } diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 153368d2a01..cdc5515f1a9 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -2310,9 +2310,10 @@ static UINT get_monitor_dpi( HMONITOR handle, UINT type, UINT *x, UINT *y ) /********************************************************************** * get_win_monitor_dpi */ -UINT get_win_monitor_dpi( HWND hwnd ) +UINT get_win_monitor_dpi( HWND hwnd, UINT *raw_dpi ) { /* FIXME: use the monitor DPI instead */ + *raw_dpi = system_dpi; return system_dpi; }
@@ -2466,7 +2467,8 @@ POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to ) */ static POINT point_win_to_phys_dpi( HWND hwnd, POINT pt ) { - return map_dpi_point( pt, get_dpi_for_window( hwnd ), get_win_monitor_dpi( hwnd ) ); + UINT raw_dpi, dpi = get_win_monitor_dpi( hwnd, &raw_dpi ); + return map_dpi_point( pt, get_dpi_for_window( hwnd ), dpi ); }
/********************************************************************** @@ -2474,7 +2476,8 @@ static POINT point_win_to_phys_dpi( HWND hwnd, POINT pt ) */ POINT point_phys_to_win_dpi( HWND hwnd, POINT pt ) { - return map_dpi_point( pt, get_win_monitor_dpi( hwnd ), get_dpi_for_window( hwnd )); + UINT raw_dpi, dpi = get_win_monitor_dpi( hwnd, &raw_dpi ); + return map_dpi_point( pt, dpi, get_dpi_for_window( hwnd ) ); }
/********************************************************************** @@ -2482,8 +2485,8 @@ POINT point_phys_to_win_dpi( HWND hwnd, POINT pt ) */ POINT point_thread_to_win_dpi( HWND hwnd, POINT pt ) { - UINT dpi = get_thread_dpi(); - if (!dpi) dpi = get_win_monitor_dpi( hwnd ); + UINT dpi = get_thread_dpi(), raw_dpi; + if (!dpi) dpi = get_win_monitor_dpi( hwnd, &raw_dpi ); return map_dpi_point( pt, dpi, get_dpi_for_window( hwnd )); }
@@ -2492,8 +2495,8 @@ POINT point_thread_to_win_dpi( HWND hwnd, POINT pt ) */ RECT rect_thread_to_win_dpi( HWND hwnd, RECT rect ) { - UINT dpi = get_thread_dpi(); - if (!dpi) dpi = get_win_monitor_dpi( hwnd ); + UINT dpi = get_thread_dpi(), raw_dpi; + if (!dpi) dpi = get_win_monitor_dpi( hwnd, &raw_dpi ); return map_dpi_rect( rect, dpi, get_dpi_for_window( hwnd ) ); }
@@ -3847,14 +3850,17 @@ MONITORINFO monitor_info_from_rect( RECT rect, UINT dpi ) return info; }
-UINT monitor_dpi_from_rect( RECT rect, UINT dpi ) +UINT monitor_dpi_from_rect( RECT rect, UINT dpi, UINT *raw_dpi ) { struct monitor *monitor; UINT ret = system_dpi, x, y;
if (!lock_display_devices()) return 0; if ((monitor = get_monitor_from_rect( rect, MONITOR_DEFAULTTONEAREST, dpi, MDT_DEFAULT ))) + { + *raw_dpi = monitor_get_dpi( monitor, MDT_RAW_DPI, &x, &y ); ret = monitor_get_dpi( monitor, MDT_DEFAULT, &x, &y ); + } unlock_display_devices();
return ret; diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index bf8b3afccc0..310498f5993 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -168,7 +168,7 @@ extern LONG get_char_dimensions( HDC hdc, TEXTMETRICW *metric, int *height ); extern HBITMAP get_display_bitmap(void); extern INT get_display_depth( UNICODE_STRING *name ); extern RECT get_display_rect( const WCHAR *display ); -extern UINT get_win_monitor_dpi( HWND hwnd ); +extern UINT get_win_monitor_dpi( HWND hwnd, UINT *raw_dpi ); extern RECT get_primary_monitor_rect( UINT dpi ); extern DWORD get_process_layout(void); extern COLORREF get_sys_color( int index ); @@ -193,7 +193,7 @@ extern RECT rect_thread_to_win_dpi( HWND hwnd, RECT rect ); extern HMONITOR monitor_from_window( HWND hwnd, UINT flags, UINT dpi ); extern MONITORINFO monitor_info_from_rect( RECT rect, UINT dpi ); extern MONITORINFO monitor_info_from_window( HWND hwnd, UINT flags ); -extern UINT monitor_dpi_from_rect( RECT rect, UINT dpi ); +extern UINT monitor_dpi_from_rect( RECT rect, UINT dpi, UINT *raw_dpi ); extern BOOL update_display_cache( BOOL force ); extern void user_lock(void); extern void user_unlock(void); diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 181c00547c9..dda35b962c2 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -894,7 +894,7 @@ UINT get_window_dpi_awareness_context( HWND hwnd ) UINT get_dpi_for_window( HWND hwnd ) { WND *win; - UINT context = 0; + UINT raw_dpi, context = 0;
if (!(win = get_win_ptr( hwnd ))) { @@ -904,7 +904,7 @@ UINT get_dpi_for_window( HWND hwnd ) if (win == WND_DESKTOP) { RECT rect = {0}; - return monitor_dpi_from_rect( rect, get_thread_dpi() ); + return monitor_dpi_from_rect( rect, get_thread_dpi(), &raw_dpi ); } if (win != WND_OTHER_PROCESS) { @@ -921,7 +921,7 @@ UINT get_dpi_for_window( HWND hwnd ) SERVER_END_REQ; }
- if (NTUSER_DPI_CONTEXT_IS_MONITOR_AWARE( context )) return get_win_monitor_dpi( hwnd ); + if (NTUSER_DPI_CONTEXT_IS_MONITOR_AWARE( context )) return get_win_monitor_dpi( hwnd, &raw_dpi ); return NTUSER_DPI_CONTEXT_GET_DPI( context ); }
@@ -1910,7 +1910,7 @@ static struct window_surface *get_window_surface( HWND hwnd, UINT swp_flags, BOO HWND parent = NtUserGetAncestor( hwnd, GA_PARENT ); struct window_surface *new_surface; struct window_rects monitor_rects; - UINT monitor_dpi, style, ex_style; + UINT raw_dpi, monitor_dpi, style, ex_style; RECT dummy; HRGN shape;
@@ -1918,8 +1918,8 @@ static struct window_surface *get_window_surface( HWND hwnd, UINT swp_flags, BOO ex_style = NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ); is_child = parent && parent != NtUserGetDesktopWindow();
- if (is_child) monitor_dpi = get_win_monitor_dpi( parent ); - else monitor_dpi = monitor_dpi_from_rect( rects->window, get_thread_dpi() ); + if (is_child) monitor_dpi = get_win_monitor_dpi( parent, &raw_dpi ); + else monitor_dpi = monitor_dpi_from_rect( rects->window, get_thread_dpi(), &raw_dpi );
if (get_window_region( hwnd, FALSE, &shape, &dummy )) shaped = FALSE; else if ((shaped = !!shape)) NtGdiDeleteObjectApp( shape ); @@ -2004,14 +2004,14 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru struct window_rects old_rects; RECT extra_rects[3]; struct window_surface *old_surface; - UINT monitor_dpi; + UINT raw_dpi, monitor_dpi;
is_layered = new_surface && new_surface->alpha_mask; is_fullscreen = is_window_rect_full_screen( &new_rects->visible, get_thread_dpi() ); is_child = parent && parent != NtUserGetDesktopWindow();
- if (is_child) monitor_dpi = get_win_monitor_dpi( parent ); - else monitor_dpi = monitor_dpi_from_rect( new_rects->window, get_thread_dpi() ); + if (is_child) monitor_dpi = get_win_monitor_dpi( parent, &raw_dpi ); + else monitor_dpi = monitor_dpi_from_rect( new_rects->window, get_thread_dpi(), &raw_dpi );
get_window_rects( hwnd, COORDS_SCREEN, &old_rects, get_thread_dpi() ); if (IsRectEmpty( &valid_rects[0] ) || is_layered) valid_rects = NULL; @@ -2284,11 +2284,13 @@ int WINAPI NtUserSetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) { UINT swp_flags = SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE; + UINT raw_dpi, dpi; HRGN monitor_hrgn;
if (!redraw) swp_flags |= SWP_NOREDRAW;
- monitor_hrgn = map_dpi_region( hrgn, get_thread_dpi(), get_win_monitor_dpi( hwnd ) ); + dpi = get_win_monitor_dpi( hwnd, &raw_dpi ); + monitor_hrgn = map_dpi_region( hrgn, get_thread_dpi(), dpi ); user_driver->pSetWindowRgn( hwnd, monitor_hrgn, redraw ); if (monitor_hrgn) NtGdiDeleteObjectApp( monitor_hrgn );
@@ -2516,10 +2518,10 @@ HWND window_from_point( HWND hwnd, POINT pt, INT *hittest ) int i, res; HWND ret, *list; POINT win_pt; - int dpi; + UINT dpi, raw_dpi;
if (!hwnd) hwnd = get_desktop_window(); - if (!(dpi = get_thread_dpi())) dpi = get_win_monitor_dpi( hwnd ); + if (!(dpi = get_thread_dpi())) dpi = get_win_monitor_dpi( hwnd, &raw_dpi );
*hittest = HTNOWHERE;
@@ -3049,7 +3051,7 @@ static BOOL get_windows_offset( HWND hwnd_from, HWND hwnd_to, UINT dpi, BOOL *mi if (win == WND_OTHER_PROCESS) goto other_process; if (win != WND_DESKTOP) { - UINT dpi_from = dpi ? dpi : get_win_monitor_dpi( hwnd_from ); + UINT raw_dpi, dpi_from = dpi ? dpi : get_win_monitor_dpi( hwnd_from, &raw_dpi ); if (win->dwExStyle & WS_EX_LAYOUTRTL) { mirror_from = TRUE; @@ -3086,7 +3088,7 @@ static BOOL get_windows_offset( HWND hwnd_from, HWND hwnd_to, UINT dpi, BOOL *mi if (win == WND_OTHER_PROCESS) goto other_process; if (win != WND_DESKTOP) { - UINT dpi_to = dpi ? dpi : get_win_monitor_dpi( hwnd_to ); + UINT raw_dpi, dpi_to = dpi ? dpi : get_win_monitor_dpi( hwnd_to, &raw_dpi ); POINT pt = { 0, 0 }; if (win->dwExStyle & WS_EX_LAYOUTRTL) { @@ -3273,9 +3275,9 @@ static void dump_winpos_flags( UINT flags ) static void map_dpi_winpos( WINDOWPOS *winpos ) { RECT rect = {winpos->x, winpos->y, winpos->x + winpos->cx, winpos->y + winpos->cy}; - UINT dpi_from = get_thread_dpi(), dpi_to = get_dpi_for_window( winpos->hwnd ); + UINT raw_dpi, dpi_from = get_thread_dpi(), dpi_to = get_dpi_for_window( winpos->hwnd );
- if (!dpi_from) dpi_from = get_win_monitor_dpi( winpos->hwnd ); + if (!dpi_from) dpi_from = get_win_monitor_dpi( winpos->hwnd, &raw_dpi ); rect = map_dpi_rect( rect, dpi_from, dpi_to ); winpos->x = rect.left; winpos->y = rect.top; @@ -5366,7 +5368,7 @@ static void map_dpi_create_struct( CREATESTRUCTW *cs, UINT dpi_to )
if (!dpi_from || !dpi_to) { - UINT mon_dpi = monitor_dpi_from_rect( rect, get_thread_dpi() ); + UINT raw_dpi, mon_dpi = monitor_dpi_from_rect( rect, get_thread_dpi(), &raw_dpi ); if (!dpi_from) dpi_from = mon_dpi; else dpi_to = mon_dpi; } @@ -5919,7 +5921,10 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) }
case NtUserCallHwndParam_GetWinMonitorDpi: - return get_win_monitor_dpi( hwnd ); + { + UINT raw_dpi, dpi = get_win_monitor_dpi( hwnd, &raw_dpi ); + return param == MDT_EFFECTIVE_DPI ? dpi : raw_dpi; + }
/* temporary exports */ case NtUserSetWindowStyle: diff --git a/dlls/wineandroid.drv/init.c b/dlls/wineandroid.drv/init.c index 75e1d5bc8e2..5e99d1d95e6 100644 --- a/dlls/wineandroid.drv/init.c +++ b/dlls/wineandroid.drv/init.c @@ -78,7 +78,7 @@ void init_monitors( int width, int height ) monitor_rc_work = virtual_screen_rect;
if (!hwnd || !NtUserIsWindowVisible( hwnd )) return; - if (!NtUserGetWindowRect( hwnd, &rect, NtUserGetWinMonitorDpi( hwnd ) )) return; + if (!NtUserGetWindowRect( hwnd, &rect, NtUserGetWinMonitorDpi( hwnd, MDT_DEFAULT ) )) return; if (rect.top) monitor_rc_work.bottom = rect.top; else monitor_rc_work.top = rect.bottom; TRACE( "found tray %p %s work area %s\n", hwnd, diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index eb2a2819e6f..3e4e9f1697d 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -98,7 +98,7 @@ static struct android_win_data *alloc_win_data( HWND hwnd ) { data->hwnd = hwnd; data->window = create_ioctl_window( hwnd, FALSE, - (float)NtUserGetWinMonitorDpi( hwnd ) / NtUserGetDpiForWindow( hwnd )); + (float)NtUserGetWinMonitorDpi( hwnd, MDT_DEFAULT ) / NtUserGetDpiForWindow( hwnd )); pthread_mutex_lock( &win_data_mutex ); win_data_context[context_idx(hwnd)] = data; } @@ -1101,7 +1101,7 @@ void ANDROID_SetParent( HWND hwnd, HWND parent, HWND old_parent ) TRACE( "win %p parent %p -> %p\n", hwnd, old_parent, parent );
data->parent = (parent == NtUserGetDesktopWindow()) ? 0 : parent; - ioctl_set_window_parent( hwnd, parent, (float)NtUserGetWinMonitorDpi( hwnd ) / NtUserGetDpiForWindow( hwnd )); + ioctl_set_window_parent( hwnd, parent, (float)NtUserGetWinMonitorDpi( hwnd, MDT_DEFAULT ) / NtUserGetDpiForWindow( hwnd )); release_win_data( data ); }
diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index bccb0caff16..b071385ecd1 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -355,7 +355,7 @@ static void sync_window_min_max_info(HWND hwnd) { LONG style = NtUserGetWindowLongW(hwnd, GWL_STYLE); LONG exstyle = NtUserGetWindowLongW(hwnd, GWL_EXSTYLE); - UINT dpi = NtUserGetWinMonitorDpi(hwnd); + UINT dpi = NtUserGetWinMonitorDpi(hwnd, MDT_DEFAULT); RECT win_rect, primary_monitor_rect; MINMAXINFO minmax; LONG adjustedStyle; @@ -1134,7 +1134,7 @@ static HMONITOR monitor_from_point(POINT pt, UINT flags) */ static LRESULT move_window(HWND hwnd, WPARAM wparam) { - UINT dpi = NtUserGetWinMonitorDpi(hwnd); + UINT dpi = NtUserGetWinMonitorDpi(hwnd, MDT_DEFAULT); MSG msg; RECT origRect, movedRect, desktopRect; int hittest = (int)(wparam & 0x0f); @@ -1161,7 +1161,7 @@ static LRESULT move_window(HWND hwnd, WPARAM wparam) else captionHeight = 0;
- NtUserGetWindowRect(hwnd, &origRect, NtUserGetWinMonitorDpi(hwnd)); + NtUserGetWindowRect(hwnd, &origRect, NtUserGetWinMonitorDpi(hwnd, MDT_DEFAULT)); movedRect = origRect;
if (!hittest) diff --git a/dlls/winewayland.drv/wayland_surface.c b/dlls/winewayland.drv/wayland_surface.c index ab8f8ac4989..b7ef362df5c 100644 --- a/dlls/winewayland.drv/wayland_surface.c +++ b/dlls/winewayland.drv/wayland_surface.c @@ -970,8 +970,8 @@ void wayland_client_surface_attach(struct wayland_client_surface *client, HWND t client->toplevel = toplevel; }
- NtUserGetClientRect(client->hwnd, &client_rect, NtUserGetWinMonitorDpi(client->hwnd)); - NtUserMapWindowPoints(client->hwnd, toplevel, (POINT *)&client_rect, 2, NtUserGetWinMonitorDpi(client->hwnd)); + NtUserGetClientRect(client->hwnd, &client_rect, NtUserGetWinMonitorDpi(client->hwnd, MDT_DEFAULT)); + NtUserMapWindowPoints(client->hwnd, toplevel, (POINT *)&client_rect, 2, NtUserGetWinMonitorDpi(client->hwnd, MDT_DEFAULT));
wayland_surface_reconfigure_client(surface, client, &client_rect); /* Commit to apply subsurface positioning. */ diff --git a/dlls/winewayland.drv/window.c b/dlls/winewayland.drv/window.c index 04642ca28c7..a5de1318141 100644 --- a/dlls/winewayland.drv/window.c +++ b/dlls/winewayland.drv/window.c @@ -193,7 +193,7 @@ static void wayland_win_data_get_config(struct wayland_win_data *data, }
conf->state = window_state; - conf->scale = NtUserGetWinMonitorDpi(data->hwnd) / 96.0; + conf->scale = NtUserGetWinMonitorDpi(data->hwnd, MDT_DEFAULT) / 96.0; conf->visible = (style & WS_VISIBLE) == WS_VISIBLE; conf->managed = data->managed; } diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index c8fc76f5048..048375e5adb 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -917,7 +917,7 @@ static BOOL X11DRV_Expose( HWND hwnd, XEvent *xev )
release_win_data( data );
- NtUserExposeWindowSurface( hwnd, flags, &rect, NtUserGetWinMonitorDpi( hwnd ) ); + NtUserExposeWindowSurface( hwnd, flags, &rect, NtUserGetWinMonitorDpi( hwnd, MDT_DEFAULT ) ); return TRUE; }
@@ -1391,7 +1391,7 @@ void X11DRV_SetFocus( HWND hwnd )
static HWND find_drop_window( HWND hQueryWnd, LPPOINT lpPt ) { - UINT dpi = NtUserGetWinMonitorDpi( hQueryWnd ); + UINT dpi = NtUserGetWinMonitorDpi( hQueryWnd, MDT_DEFAULT ); RECT tempRect;
if (!NtUserIsWindowEnabled(hQueryWnd)) return 0; diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index fed34a394e7..a8900f9c165 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -196,7 +196,7 @@ static HFONT X11DRV_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags )
BOOL needs_offscreen_rendering( HWND hwnd, BOOL known_child ) { - if (NtUserGetDpiForWindow( hwnd ) != NtUserGetWinMonitorDpi( hwnd )) return TRUE; /* needs DPI scaling */ + if (NtUserGetDpiForWindow( hwnd ) != NtUserGetWinMonitorDpi( hwnd, MDT_DEFAULT )) return TRUE; /* needs DPI scaling */ if (NtUserGetAncestor( hwnd, GA_PARENT ) != NtUserGetDesktopWindow()) return TRUE; /* child window, needs compositing */ if (NtUserGetWindowRelative( hwnd, GW_CHILD )) return TRUE; /* window has children, needs compositing */ if (known_child) return TRUE; /* window is/have children, needs compositing */ diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index f7623121b32..d82fd01233d 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1898,8 +1898,8 @@ static void present_gl_drawable( HWND hwnd, HDC hdc, struct gl_drawable *gl, BOO
if (flush) XFlush( gdi_display );
- NtUserGetClientRect( hwnd, &rect_dst, NtUserGetWinMonitorDpi( hwnd ) ); - NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, NtUserGetWinMonitorDpi( hwnd ) ); + NtUserGetClientRect( hwnd, &rect_dst, NtUserGetWinMonitorDpi( hwnd, MDT_DEFAULT ) ); + NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, NtUserGetWinMonitorDpi( hwnd, MDT_DEFAULT ) );
if ((data = get_win_data( toplevel ))) { diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index f300ddffe58..8705b470740 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -221,8 +221,8 @@ static void X11DRV_vulkan_surface_presented( HWND hwnd, void *private, VkResult window = X11DRV_get_whole_window( toplevel ); region = get_dc_monitor_region( hwnd, hdc );
- NtUserGetClientRect( hwnd, &rect_dst, NtUserGetWinMonitorDpi( hwnd ) ); - NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, NtUserGetWinMonitorDpi( hwnd ) ); + NtUserGetClientRect( hwnd, &rect_dst, NtUserGetWinMonitorDpi( hwnd, MDT_DEFAULT ) ); + NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, NtUserGetWinMonitorDpi( hwnd, MDT_DEFAULT ) );
if ((data = get_win_data( toplevel ))) { diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index b3747dda705..2fcebbe3dbe 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1601,7 +1601,7 @@ Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colo HWND parent = NtUserGetAncestor( hwnd, GA_PARENT ); if (parent == NtUserGetDesktopWindow() || NtUserGetAncestor( parent, GA_PARENT )) return 0; if (!(data = alloc_win_data( thread_init_display(), hwnd ))) return 0; - NtUserGetClientRect( hwnd, &data->rects.client, NtUserGetWinMonitorDpi( hwnd ) ); + NtUserGetClientRect( hwnd, &data->rects.client, NtUserGetWinMonitorDpi( hwnd, MDT_DEFAULT ) ); data->rects.window = data->rects.visible = data->rects.client; }
diff --git a/include/ntuser.h b/include/ntuser.h index fb6955ea0ec..558dfacea20 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -1544,9 +1544,9 @@ static inline BOOL NtUserExposeWindowSurface( HWND hwnd, UINT flags, const RECT return NtUserCallHwndParam( hwnd, (UINT_PTR)¶ms, NtUserCallHwndParam_ExposeWindowSurface ); }
-static inline UINT NtUserGetWinMonitorDpi( HWND hwnd ) +static inline UINT NtUserGetWinMonitorDpi( HWND hwnd, MONITOR_DPI_TYPE type ) { - return NtUserCallHwndParam( hwnd, 0, NtUserCallHwndParam_GetWinMonitorDpi ); + return NtUserCallHwndParam( hwnd, type, NtUserCallHwndParam_GetWinMonitorDpi ); }
#endif /* _NTUSER_ */