[gtk+] Revert "gdk-win32: Clean Up A Bit"



commit c6a8ead9312c25f75104a5ab01936aaddeb660b2
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Apr 17 11:29:07 2015 +0800

    Revert "gdk-win32: Clean Up A Bit"
    
    This reverts commit 24d3f3fcb2894df110a17317260b8705d68d22ec.
    
    Sorry, I am going to re-commit this very shortly with a new
    commit message, as I found the commit message to be quite
    wrong and misleading.

 gdk/win32/gdkcursor-win32.c |   17 ++++++++++++++++-
 gdk/win32/gdkwindow-win32.c |    8 ++++++--
 2 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/gdk/win32/gdkcursor-win32.c b/gdk/win32/gdkcursor-win32.c
index eb4a454..28b2745 100644
--- a/gdk/win32/gdkcursor-win32.c
+++ b/gdk/win32/gdkcursor-win32.c
@@ -821,7 +821,22 @@ _gdk_win32_pixbuf_to_hcursor (GdkPixbuf *pixbuf,
 gboolean
 _gdk_win32_pixbuf_to_hicon_supports_alpha (void)
 {
-  return TRUE;
+  static gboolean is_win_xp=FALSE, is_win_xp_checked=FALSE;
+
+  if (!is_win_xp_checked)
+    {
+      OSVERSIONINFO version;
+
+      is_win_xp_checked = TRUE;
+
+      memset (&version, 0, sizeof (version));
+      version.dwOSVersionInfoSize = sizeof (version);
+      is_win_xp = GetVersionEx (&version)
+       && version.dwPlatformId == VER_PLATFORM_WIN32_NT
+       && (version.dwMajorVersion > 5
+           || (version.dwMajorVersion == 5 && version.dwMinorVersion >= 1));
+    }
+  return is_win_xp;
 }
 
 HICON
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index da85ded..3e568a4 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -375,8 +375,12 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
             {
               wcl.lpszClassName = L"gdkWindowTempShadow";
               wcl.style |= CS_SAVEBITS;
-              wcl.style |= 0x00020000; /* CS_DROPSHADOW */
-
+              if (LOBYTE (g_win32_get_windows_version()) > 0x05 ||
+                 LOWORD (g_win32_get_windows_version()) == 0x0105)
+               {
+                 /* Windows XP (5.1) or above */
+                 wcl.style |= 0x00020000; /* CS_DROPSHADOW */
+               }
               ONCE_PER_CLASS ();
               klassTEMPSHADOW = RegisterClassExW (&wcl);
             }


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