Commit 8d69490f authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

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=53298Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com>
parent e2daffda
......@@ -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);
}
......
......@@ -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);
......
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