win32 theme: No need to create a DC for GetThemePartSize

https://bugzilla.gnome.org/show_bug.cgi?id=773221
This commit is contained in:
Jaime Velasco Juan 2016-10-14 09:24:13 +01:00 committed by Benjamin Otte
parent 77ff3ada62
commit 7e3f9d6f71

View File

@ -453,14 +453,11 @@ gtk_win32_theme_get_part_size (GtkWin32Theme *theme,
#ifdef G_OS_WIN32
HTHEME htheme = gtk_win32_theme_get_htheme (theme);
SIZE size;
HDC hdc;
HRESULT res;
if (use_xp_theme && GetThemePartSize != NULL && htheme != NULL)
{
hdc = GetDC (NULL);
res = GetThemePartSize (htheme, hdc, part, state, NULL, 1 /* TS_TRUE */, &size);
ReleaseDC (NULL, hdc);
res = GetThemePartSize (htheme, NULL, part, state, NULL, 1 /* TS_TRUE */, &size);
if (SUCCEEDED (res))
{