gdk-win32: Clean Up A Bit

As GLib dropped Windows 2000 support some time ago [1][2], and the current
git master already depends on a GLib release that is well after it dropped
Windows 2000 support, clean up the code a bit as we are assured that the
code will run on XP and later, plus, we have dropped XP support during
this cycle with commit b85f0cc.

https://bugzilla.gnome.org/show_bug.cgi?id=741849

[1]: https://git.gnome.org/browse/glib/commit/?id=80c24d36f2525d83e458ebbdf62fdbd085945a02
[2]: https://git.gnome.org/browse/glib/commit/?id=731b46990896665a8107535080bb075a6e18b6f7
This commit is contained in:
Chun-wei Fan 2015-04-15 17:17:06 +08:00
parent c6a8ead931
commit bbac0eb3b9
2 changed files with 3 additions and 22 deletions

View File

@ -821,22 +821,7 @@ _gdk_win32_pixbuf_to_hcursor (GdkPixbuf *pixbuf,
gboolean
_gdk_win32_pixbuf_to_hicon_supports_alpha (void)
{
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;
return TRUE;
}
HICON

View File

@ -375,12 +375,8 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
{
wcl.lpszClassName = L"gdkWindowTempShadow";
wcl.style |= CS_SAVEBITS;
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 */
}
wcl.style |= 0x00020000; /* CS_DROPSHADOW */
ONCE_PER_CLASS ();
klassTEMPSHADOW = RegisterClassExW (&wcl);
}