1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-09 04:16:08 +00:00

uxtheme: Use system DPI for OpenThemeData() without valid window handles.

Tested manually on Wine for 96, 120, 144, 168, 192 and 216 DPI.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53298
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
This commit is contained in:
Zhiyi Zhang 2022-07-04 23:18:12 +08:00 committed by Alexandre Julliard
parent e2daffda25
commit 8d69490fb7
2 changed files with 1 additions and 5 deletions

View File

@ -663,7 +663,7 @@ HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags)
dpi = GetDpiForWindow(hwnd);
if (!dpi)
dpi = 96;
dpi = GetDpiForSystem();
return open_theme_data(hwnd, pszClassList, flags, dpi);
}

View File

@ -1122,12 +1122,10 @@ static void test_GetThemePartSize(void)
hr = GetThemePartSize(htheme, hdc, BP_CHECKBOX, CBS_CHECKEDNORMAL, NULL, TS_DRAW, &size);
ok(hr == S_OK, "GetThemePartSize failed, hr %#lx.\n", hr);
todo_wine_if(target_dpi != 96)
ok(compare_uint(size.cx, expected, 1) && compare_uint(size.cy, expected, 1),
"Got unexpected size %ldx%ld.\n", size.cx, size.cy);
hr = GetThemePartSize(htheme, NULL, BP_CHECKBOX, CBS_CHECKEDNORMAL, NULL, TS_DRAW, &size);
ok(hr == S_OK, "GetThemePartSize failed, hr %#lx.\n", hr);
todo_wine_if(target_dpi != 96)
ok(compare_uint(size.cx, expected, 1) && compare_uint(size.cy, expected, 1),
"Got unexpected size %ldx%ld.\n", size.cx, size.cy);
CloseThemeData(htheme);
@ -1145,12 +1143,10 @@ static void test_GetThemePartSize(void)
htheme = OpenThemeData(NULL, WC_BUTTONW);
hr = GetThemePartSize(htheme, hdc, BP_CHECKBOX, CBS_CHECKEDNORMAL, NULL, TS_DRAW, &size);
ok(hr == S_OK, "GetThemePartSize failed, hr %#lx.\n", hr);
todo_wine_if(target_dpi != 96)
ok(compare_uint(size.cx, expected, 1) && compare_uint(size.cy, expected, 1),
"Got unexpected size %ldx%ld.\n", size.cx, size.cy);
hr = GetThemePartSize(htheme, NULL, BP_CHECKBOX, CBS_CHECKEDNORMAL, NULL, TS_DRAW, &size);
ok(hr == S_OK, "GetThemePartSize failed, hr %#lx.\n", hr);
todo_wine_if(target_dpi != 96)
ok(compare_uint(size.cx, expected, 1) && compare_uint(size.cy, expected, 1),
"Got unexpected size %ldx%ld.\n", size.cx, size.cy);
CloseThemeData(htheme);