[gtk+/master.fcw: 532/648] Revert "gdkcursor-win32.c: Simplify OS Version Check"
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/master.fcw: 532/648] Revert "gdkcursor-win32.c: Simplify OS Version Check"
- Date: Wed, 4 Feb 2015 05:08:20 +0000 (UTC)
commit 9cada88db0aeb283bcb846ea30be3abace763301
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Jan 21 16:43:15 2015 +0800
Revert "gdkcursor-win32.c: Simplify OS Version Check"
This reverts commit c5d8bd219c3e8bd713004e471a03feedc700b5f4.
gdk/win32/gdkcursor-win32.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/gdk/win32/gdkcursor-win32.c b/gdk/win32/gdkcursor-win32.c
index f041d96..28b2745 100644
--- a/gdk/win32/gdkcursor-win32.c
+++ b/gdk/win32/gdkcursor-win32.c
@@ -821,13 +821,20 @@ _gdk_win32_pixbuf_to_hcursor (GdkPixbuf *pixbuf,
gboolean
_gdk_win32_pixbuf_to_hicon_supports_alpha (void)
{
- static gboolean is_win_xp=FALSE;
- static gsize is_win_xp_checked;
+ static gboolean is_win_xp=FALSE, is_win_xp_checked=FALSE;
- if (g_once_init_enter (&is_win_xp_checked))
+ if (!is_win_xp_checked)
{
- is_win_xp = g_win32_windows_is_at_least (5, 1, 0, G_WIN32_OS_ANY);
- g_once_init_leave (&is_win_xp_checked, 1);
+ 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]