From 348bffc85650bb9cdeccfe1bbc7d88d7bff62e17 Mon Sep 17 00:00:00 2001 From: Richard Hult Date: Mon, 24 Jul 2006 12:31:17 +0000 Subject: [PATCH] Implement getting the double click threshold. 2006-07-24 Richard Hult * gdk/quartz/gdkevents-quartz.c (gdk_screen_get_setting): Implement getting the double click threshold. --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ gdk/quartz/gdkevents-quartz.c | 24 +++++++++++++++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 81d59a1f7c..48f792e547 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-07-24 Richard Hult + + * gdk/quartz/gdkevents-quartz.c (gdk_screen_get_setting): Implement + getting the double click threshold. + 2006-07-24 Richard Hult * gdk/quartz/gdkwindow-quartz.c (gdk_window_set_type_hint): Set the diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 81d59a1f7c..48f792e547 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2006-07-24 Richard Hult + + * gdk/quartz/gdkevents-quartz.c (gdk_screen_get_setting): Implement + getting the double click threshold. + 2006-07-24 Richard Hult * gdk/quartz/gdkwindow-quartz.c (gdk_window_set_type_hint): Set the diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c index 98bb4e140c..ee3f9a6c56 100644 --- a/gdk/quartz/gdkevents-quartz.c +++ b/gdk/quartz/gdkevents-quartz.c @@ -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 */