[gtk+] quartz: call Gestalt() only once per session in gdk_quartz_osx_version()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] quartz: call Gestalt() only once per session in gdk_quartz_osx_version()
- Date: Thu, 29 Nov 2012 14:01:55 +0000 (UTC)
commit e2144fbb7e77954e8f038930360d8ac3960d9fc2
Author: Michael Natterer <mitch gimp org>
Date: Thu Nov 29 14:44:04 2012 +0100
quartz: call Gestalt() only once per session in gdk_quartz_osx_version()
Thanks to Paul Davis for pointing this out.
(cherry picked from commit d6533ffc44d77b42cce7987f249fa481581b7c50)
gdk/quartz/gdkglobals-quartz.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/gdk/quartz/gdkglobals-quartz.c b/gdk/quartz/gdkglobals-quartz.c
index a185d2a..c6a7a22 100644
--- a/gdk/quartz/gdkglobals-quartz.c
+++ b/gdk/quartz/gdkglobals-quartz.c
@@ -28,9 +28,14 @@ GdkWindow *_gdk_root = NULL;
GdkOSXVersion
gdk_quartz_osx_version (void)
{
- gint minor;
- OSErr err = Gestalt (gestaltSystemVersionMinor, &minor);
- g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED);
+ static gint32 minor = 0;
+
+ if (!minor)
+ {
+ OSErr err = Gestalt (gestaltSystemVersionMinor, (SInt32*)&minor);
+
+ g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED);
+ }
if (minor < GDK_OSX_MIN)
return GDK_OSX_UNSUPPORTED;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]