Commit 338179ae authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Directly access system DPI in ntgdi.

parent 3570b091
...@@ -572,16 +572,6 @@ BOOL GDI_dec_ref_count( HGDIOBJ handle ) ...@@ -572,16 +572,6 @@ BOOL GDI_dec_ref_count( HGDIOBJ handle )
} }
/******************************************************************************
* get_system_dpi
*
* Get the system DPI, based on the DPI awareness mode.
*/
DWORD get_system_dpi(void)
{
return user_callbacks ? user_callbacks->pGetDpiForSystem() : 96;
}
static HFONT create_font( const LOGFONTW *deffont ) static HFONT create_font( const LOGFONTW *deffont )
{ {
ENUMLOGFONTEXDVW lf; ENUMLOGFONTEXDVW lf;
......
...@@ -1395,6 +1395,13 @@ static UINT get_thread_dpi(void) ...@@ -1395,6 +1395,13 @@ static UINT get_thread_dpi(void)
} }
} }
/* see GetDpiForSystem */
UINT get_system_dpi(void)
{
if (get_thread_dpi_awareness() == DPI_AWARENESS_UNAWARE) return USER_DEFAULT_SCREEN_DPI;
return system_dpi;
}
/********************************************************************** /**********************************************************************
* map_dpi_rect * map_dpi_rect
*/ */
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
struct user_callbacks struct user_callbacks
{ {
HWND (WINAPI *pGetDesktopWindow)(void); HWND (WINAPI *pGetDesktopWindow)(void);
UINT (WINAPI *pGetDpiForSystem)(void);
BOOL (WINAPI *pGetMonitorInfoW)( HMONITOR, LPMONITORINFO ); BOOL (WINAPI *pGetMonitorInfoW)( HMONITOR, LPMONITORINFO );
INT (WINAPI *pGetSystemMetrics)(INT); INT (WINAPI *pGetSystemMetrics)(INT);
BOOL (WINAPI *pGetWindowRect)( HWND hwnd, LPRECT rect ); BOOL (WINAPI *pGetWindowRect)( HWND hwnd, LPRECT rect );
...@@ -241,6 +240,7 @@ struct unix_funcs ...@@ -241,6 +240,7 @@ struct unix_funcs
struct window_surface *surface ); struct window_surface *surface );
}; };
extern UINT get_system_dpi(void) DECLSPEC_HIDDEN;
extern RECT get_virtual_screen_rect(void) DECLSPEC_HIDDEN; extern RECT get_virtual_screen_rect(void) DECLSPEC_HIDDEN;
extern void wrappers_init( unixlib_handle_t handle ) DECLSPEC_HIDDEN; extern void wrappers_init( unixlib_handle_t handle ) DECLSPEC_HIDDEN;
......
...@@ -940,14 +940,6 @@ static HWND WINAPI call_GetDesktopWindow(void) ...@@ -940,14 +940,6 @@ static HWND WINAPI call_GetDesktopWindow(void)
return pGetDesktopWindow ? pGetDesktopWindow() : NULL; return pGetDesktopWindow ? pGetDesktopWindow() : NULL;
} }
static UINT WINAPI call_GetDpiForSystem(void)
{
static UINT (WINAPI *pGetDpiForSystem)(void);
if (!pGetDpiForSystem)
pGetDpiForSystem = get_user_proc( "GetDpiForSystem", FALSE );
return pGetDpiForSystem ? pGetDpiForSystem() : 96;
}
static BOOL WINAPI call_GetMonitorInfoW( HMONITOR monitor, MONITORINFO *info ) static BOOL WINAPI call_GetMonitorInfoW( HMONITOR monitor, MONITORINFO *info )
{ {
static BOOL (WINAPI *pGetMonitorInfoW)( HMONITOR, LPMONITORINFO ); static BOOL (WINAPI *pGetMonitorInfoW)( HMONITOR, LPMONITORINFO );
...@@ -1000,7 +992,6 @@ static HWND WINAPI call_WindowFromDC( HDC hdc ) ...@@ -1000,7 +992,6 @@ static HWND WINAPI call_WindowFromDC( HDC hdc )
static const struct user_callbacks user_funcs = static const struct user_callbacks user_funcs =
{ {
call_GetDesktopWindow, call_GetDesktopWindow,
call_GetDpiForSystem,
call_GetMonitorInfoW, call_GetMonitorInfoW,
call_GetSystemMetrics, call_GetSystemMetrics,
call_GetWindowRect, call_GetWindowRect,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment