[PATCH] user32/button: Use per-window dpi settings.

Nikolay Sivov nsivov at codeweavers.com
Tue Jul 17 06:13:04 CDT 2018


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/user32/button.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/button.c b/dlls/user32/button.c
index 7684e7f2fa..9255a46343 100644
--- a/dlls/user32/button.c
+++ b/dlls/user32/button.c
@@ -842,8 +842,8 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
     GetClientRect(hwnd, &client);
     rbox = rtext = client;
 
-    checkBoxWidth  = 12 * GetDeviceCaps( hDC, LOGPIXELSX ) / 96 + 1;
-    checkBoxHeight = 12 * GetDeviceCaps( hDC, LOGPIXELSY ) / 96 + 1;
+    checkBoxWidth  = 12 * GetDpiForWindow( hwnd ) / 96 + 1;
+    checkBoxHeight = 12 * GetDpiForWindow( hwnd ) / 96 + 1;
 
     if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont );
     GetCharWidthW( hDC, '0', '0', &text_offset );
-- 
2.18.0




More information about the wine-devel mailing list