diff --git a/gdk/quartz/gdkdisplay-quartz.c b/gdk/quartz/gdkdisplay-quartz.c
index 6884d00..198ff63 100644
--- a/gdk/quartz/gdkdisplay-quartz.c
+++ b/gdk/quartz/gdkdisplay-quartz.c
@@ -65,6 +65,8 @@ gdk_display_open (const gchar *display_name)
   _gdk_dnd_init ();
 #endif
 
+  _gdk_quartz_set_osx_version ();
+
   g_signal_emit_by_name (gdk_display_manager_get (),
 			 "display_opened", _gdk_display);
 
diff --git a/gdk/quartz/gdkglobals-quartz.c b/gdk/quartz/gdkglobals-quartz.c
index 6dd43dc..81bab07 100644
--- a/gdk/quartz/gdkglobals-quartz.c
+++ b/gdk/quartz/gdkglobals-quartz.c
@@ -21,7 +21,35 @@
 #include "config.h"
 #include "gdktypes.h"
 #include "gdkprivate.h"
+#include "gdkquartz.h"
+#include <sys/utsname.h>
+#include <stdio.h>
 
 GdkDisplay *_gdk_display = NULL;
 GdkScreen *_gdk_screen = NULL;
 GdkWindow *_gdk_root = NULL;
+
+static GdkOSXVersion _gdk_osx_version = GDK_OSX_UNSUPPORTED;
+
+const GdkOSXVersion
+gdk_quartz_osx_version (void)
+{
+  return _gdk_osx_version;
+}
+
+void
+_gdk_quartz_set_osx_version (void)
+{
+  struct utsname version;
+  gint major, minor, nano;
+  if (uname (&version) == 0)
+    {
+      sscanf (version.release, "%d.%d.%d", &major, &minor, &nano);
+      if (major < GDK_OSX_MIN)
+	_gdk_osx_version = GDK_OSX_UNSUPPORTED;
+      else if (major > GDK_OSX_CURRENT)
+	_gdk_osx_version = GDK_OSX_NEW;
+      else
+	_gdk_osx_version = major;
+    }
+}
diff --git a/gdk/quartz/gdkprivate-quartz.h b/gdk/quartz/gdkprivate-quartz.h
index 1a2526e..20035b5 100644
--- a/gdk/quartz/gdkprivate-quartz.h
+++ b/gdk/quartz/gdkprivate-quartz.h
@@ -213,4 +213,7 @@ gboolean    _gdk_quartz_window_queue_antiexpose  (GdkWindow *window,
 /* Pixmap */
 CGImageRef _gdk_pixmap_get_cgimage (GdkPixmap *pixmap);
 
+/* OSX Version */
+void       _gdk_quartz_set_osx_version (void);
+
 #endif /* __GDK_PRIVATE_QUARTZ_H__ */
diff --git a/gdk/quartz/gdkquartz.h b/gdk/quartz/gdkquartz.h
index 48c4748..b5a2a19 100644
--- a/gdk/quartz/gdkquartz.h
+++ b/gdk/quartz/gdkquartz.h
@@ -24,6 +24,8 @@
 #include <AppKit/AppKit.h>
 #include <gdk/gdkprivate.h>
 
+
+
 G_BEGIN_DECLS
 
 /* NSInteger only exists in Leopard and newer.  This check has to be
@@ -39,11 +41,24 @@ typedef unsigned int NSUInteger;
 typedef float CGFloat;
 #endif
 
+typedef enum
+{
+  GDK_OSX_UNSUPPORTED = 0,
+  GDK_OSX_MIN = 8,
+  GDK_OSX_TIGER = 8,
+  GDK_OSX_LEOPARD = 9,
+  GDK_OSX_SNOW_LEOPARD = 10,
+  GDK_OSX_LION = 11,
+  GDK_OSX_CURRENT = 11,
+  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);
+const GdkOSXVersion gdk_quartz_osx_version                      (void);
 
 G_END_DECLS
 
