]> Pileus Git - ~andy/gtk/commitdiff
Implement getting the double click threshold.
authorRichard Hult <richard@imendio.com>
Mon, 24 Jul 2006 12:31:17 +0000 (12:31 +0000)
committerRichard Hult <rhult@src.gnome.org>
Mon, 24 Jul 2006 12:31:17 +0000 (12:31 +0000)
2006-07-24  Richard Hult  <richard@imendio.com>

* gdk/quartz/gdkevents-quartz.c (gdk_screen_get_setting): Implement
getting the double click threshold.

ChangeLog
ChangeLog.pre-2-10
gdk/quartz/gdkevents-quartz.c

index 81d59a1f7ca8653ffd9c79568e57371cbdb905bb..48f792e54765ce0bad78b6baa6d5d2b5adf7f9da 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-07-24  Richard Hult  <richard@imendio.com>
+
+       * gdk/quartz/gdkevents-quartz.c (gdk_screen_get_setting): Implement
+       getting the double click threshold.
+
 2006-07-24  Richard Hult  <richard@imendio.com>
 
        * gdk/quartz/gdkwindow-quartz.c (gdk_window_set_type_hint): Set the
index 81d59a1f7ca8653ffd9c79568e57371cbdb905bb..48f792e54765ce0bad78b6baa6d5d2b5adf7f9da 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-24  Richard Hult  <richard@imendio.com>
+
+       * gdk/quartz/gdkevents-quartz.c (gdk_screen_get_setting): Implement
+       getting the double click threshold.
+
 2006-07-24  Richard Hult  <richard@imendio.com>
 
        * gdk/quartz/gdkwindow-quartz.c (gdk_window_set_type_hint): Set the
index 98bb4e140c46bfd82990b44afd53836b022e5bc3..ee3f9a6c5650d279b8d3814e40c23a4f6e5fa6c9 100644 (file)
@@ -1598,12 +1598,34 @@ gdk_screen_get_setting (GdkScreen   *screen,
                        const gchar *name,
                        GValue      *value)
 {
+  /* FIXME: This should be fetched from the correct preference value. See:
+     http://developer.apple.com/documentation/UserExperience/\
+     Conceptual/OSXHIGuidelines/XHIGText/chapter_13_section_2.html
+  */
   if (strcmp (name, "gtk-font-name") == 0)
     {
-      /* FIXME: This should be fetched from the correct preference value */
       g_value_set_string (value, "Lucida Grande 13");
       return TRUE;
     }
+  else if (strcmp (name, "gtk-double-click-time") == 0)
+    {
+      NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+      float t;
+
+      GDK_QUARTZ_ALLOC_POOL;
+            
+      t = [defaults floatForKey:@"com.apple.mouse.doubleClickThreshold"];
+      if (t == 0.0)
+       {
+         /* No user setting, use the default in OS X. */
+         t = 0.5;
+       }
+
+      GDK_QUARTZ_RELEASE_POOL;
+
+      g_value_set_int (value, t * 1000);
+      return TRUE;
+    }
   
   /* FIXME: Add more settings */