diff --git a/gdk/quartz/gdkglobals-quartz.c b/gdk/quartz/gdkglobals-quartz.c
index 6dd43dc..edfd587 100644
--- a/gdk/quartz/gdkglobals-quartz.c
+++ b/gdk/quartz/gdkglobals-quartz.c
@@ -21,7 +21,24 @@
 #include "config.h"
 #include "gdktypes.h"
 #include "gdkprivate.h"
+#include "gdkquartz.h"
 
 GdkDisplay *_gdk_display = NULL;
 GdkScreen *_gdk_screen = NULL;
 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);
+
+  if (minor < GDK_OSX_MIN)
+      return GDK_OSX_UNSUPPORTED;
+  else if (minor > GDK_OSX_CURRENT)
+      return GDK_OSX_NEW;
+  else
+      return minor;
+
+}
diff --git a/gdk/quartz/gdkquartz.h b/gdk/quartz/gdkquartz.h
index 48c4748..742d651 100644
--- a/gdk/quartz/gdkquartz.h
+++ b/gdk/quartz/gdkquartz.h
@@ -39,11 +39,24 @@ typedef unsigned int NSUInteger;
 typedef float CGFloat;
 #endif
 
+typedef enum
+{
+  GDK_OSX_UNSUPPORTED = 0,
+  GDK_OSX_MIN = 4,
+  GDK_OSX_TIGER = 4,
+  GDK_OSX_LEOPARD = 5,
+  GDK_OSX_SNOW_LEOPARD = 6,
+  GDK_OSX_LION = 7,
+  GDK_OSX_CURRENT = 7,
+  GDK_OSX_NEW = 99
+} GdkOSXVersion;
+
 NSWindow *gdk_quartz_window_get_nswindow                        (GdkWindow      *window);
 NSView   *gdk_quartz_window_get_nsview                          (GdkWindow      *window);
 NSImage  *gdk_quartz_pixbuf_to_ns_image_libgtk_only             (GdkPixbuf      *pixbuf);
 id        gdk_quartz_drag_context_get_dragging_info_libgtk_only (GdkDragContext *context);
 NSEvent  *gdk_quartz_event_get_nsevent                          (GdkEvent       *event);
+GdkOSXVersion gdk_quartz_osx_version                            (void);
 
 G_END_DECLS
 
