[gtk+/gtk-3-22] win32 theme: No need to create a DC for GetThemePartSize



commit 424b59aec6173a62b54e8f6ad3b07a2b5d687498
Author: Jaime Velasco Juan <jsagarribay gmail com>
Date:   Fri Oct 14 09:24:13 2016 +0100

    win32 theme: No need to create a DC for GetThemePartSize
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773221

 gtk/gtkwin32theme.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwin32theme.c b/gtk/gtkwin32theme.c
index 0b96051..c5f66dd 100644
--- a/gtk/gtkwin32theme.c
+++ b/gtk/gtkwin32theme.c
@@ -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))
         {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]