mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 23:04:05 +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:
parent
e2daffda25
commit
8d69490fb7
|
@ -663,7 +663,7 @@ HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags)
|
||||||
|
|
||||||
dpi = GetDpiForWindow(hwnd);
|
dpi = GetDpiForWindow(hwnd);
|
||||||
if (!dpi)
|
if (!dpi)
|
||||||
dpi = 96;
|
dpi = GetDpiForSystem();
|
||||||
|
|
||||||
return open_theme_data(hwnd, pszClassList, flags, dpi);
|
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);
|
hr = GetThemePartSize(htheme, hdc, BP_CHECKBOX, CBS_CHECKEDNORMAL, NULL, TS_DRAW, &size);
|
||||||
ok(hr == S_OK, "GetThemePartSize failed, hr %#lx.\n", hr);
|
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),
|
ok(compare_uint(size.cx, expected, 1) && compare_uint(size.cy, expected, 1),
|
||||||
"Got unexpected size %ldx%ld.\n", size.cx, size.cy);
|
"Got unexpected size %ldx%ld.\n", size.cx, size.cy);
|
||||||
hr = GetThemePartSize(htheme, NULL, BP_CHECKBOX, CBS_CHECKEDNORMAL, NULL, TS_DRAW, &size);
|
hr = GetThemePartSize(htheme, NULL, BP_CHECKBOX, CBS_CHECKEDNORMAL, NULL, TS_DRAW, &size);
|
||||||
ok(hr == S_OK, "GetThemePartSize failed, hr %#lx.\n", hr);
|
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),
|
ok(compare_uint(size.cx, expected, 1) && compare_uint(size.cy, expected, 1),
|
||||||
"Got unexpected size %ldx%ld.\n", size.cx, size.cy);
|
"Got unexpected size %ldx%ld.\n", size.cx, size.cy);
|
||||||
CloseThemeData(htheme);
|
CloseThemeData(htheme);
|
||||||
|
@ -1145,12 +1143,10 @@ static void test_GetThemePartSize(void)
|
||||||
htheme = OpenThemeData(NULL, WC_BUTTONW);
|
htheme = OpenThemeData(NULL, WC_BUTTONW);
|
||||||
hr = GetThemePartSize(htheme, hdc, BP_CHECKBOX, CBS_CHECKEDNORMAL, NULL, TS_DRAW, &size);
|
hr = GetThemePartSize(htheme, hdc, BP_CHECKBOX, CBS_CHECKEDNORMAL, NULL, TS_DRAW, &size);
|
||||||
ok(hr == S_OK, "GetThemePartSize failed, hr %#lx.\n", hr);
|
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),
|
ok(compare_uint(size.cx, expected, 1) && compare_uint(size.cy, expected, 1),
|
||||||
"Got unexpected size %ldx%ld.\n", size.cx, size.cy);
|
"Got unexpected size %ldx%ld.\n", size.cx, size.cy);
|
||||||
hr = GetThemePartSize(htheme, NULL, BP_CHECKBOX, CBS_CHECKEDNORMAL, NULL, TS_DRAW, &size);
|
hr = GetThemePartSize(htheme, NULL, BP_CHECKBOX, CBS_CHECKEDNORMAL, NULL, TS_DRAW, &size);
|
||||||
ok(hr == S_OK, "GetThemePartSize failed, hr %#lx.\n", hr);
|
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),
|
ok(compare_uint(size.cx, expected, 1) && compare_uint(size.cy, expected, 1),
|
||||||
"Got unexpected size %ldx%ld.\n", size.cx, size.cy);
|
"Got unexpected size %ldx%ld.\n", size.cx, size.cy);
|
||||||
CloseThemeData(htheme);
|
CloseThemeData(htheme);
|
||||||
|
|
Loading…
Reference in a new issue