From 9ffbca6d142a784ca713285c4b234244161c946d Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Fri, 15 Oct 2021 09:56:51 +0800 Subject: [PATCH 46/51] winex11.drv: Add map_dpi_point() helper. To: wine-devel@winehq.org Signed-off-by: Zhiyi Zhang --- dlls/winex11.drv/window.c | 9 +++++++++ dlls/winex11.drv/x11drv.h | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index b82680f28d0..ff97e0f1eea 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1579,6 +1579,15 @@ Window create_client_window( HWND hwnd, const XVisualInfo *visual ) return ret; } +POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to ) +{ + if (dpi_from && dpi_to && dpi_from != dpi_to) + { + pt.x = MulDiv( pt.x, dpi_to, dpi_from ); + pt.y = MulDiv( pt.y, dpi_to, dpi_from ); + } + return pt; +} /********************************************************************** * create_whole_window diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 52cf4bc83f5..586635cbb8c 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -708,8 +708,13 @@ extern void xinerama_get_fullscreen_monitors( const RECT *rect, long *indices ) extern void xinerama_init( unsigned int width, unsigned int height ) DECLSPEC_HIDDEN; extern void init_recursive_mutex( pthread_mutex_t *mutex ) DECLSPEC_HIDDEN; + extern RECT get_virtual_screen_rect(void) DECLSPEC_HIDDEN; +/* DPI unaware scaling helpers */ +extern RECT dpi_unaware_get_virtual_screen_rect(void) DECLSPEC_HIDDEN; +extern POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to ) DECLSPEC_HIDDEN; + #define DEPTH_COUNT 3 extern const unsigned int *depths DECLSPEC_HIDDEN; -- 2.32.0