summaryrefslogtreecommitdiffstats
path: root/views/view_gtk.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-05 22:26:49 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-05 22:26:49 +0000
commitf05f1f173c8e690098b9cdf34e7ae0aaaa31fb22 (patch)
tree5286d122572ff5f0edaa1d415b74e9c6f667d9ea /views/view_gtk.cc
parent108c2a1d2780d49121e16b18a29580ef4d28c790 (diff)
downloadchromium_src-f05f1f173c8e690098b9cdf34e7ae0aaaa31fb22.zip
chromium_src-f05f1f173c8e690098b9cdf34e7ae0aaaa31fb22.tar.gz
chromium_src-f05f1f173c8e690098b9cdf34e7ae0aaaa31fb22.tar.bz2
Implements View::GetXXXDragThreshold on Linux.
BUG=none TEST=none Review URL: http://codereview.chromium.org/118335 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17783 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/view_gtk.cc')
-rw-r--r--views/view_gtk.cc23
1 files changed, 17 insertions, 6 deletions
diff --git a/views/view_gtk.cc b/views/view_gtk.cc
index 4edb9e3..5293db1 100644
--- a/views/view_gtk.cc
+++ b/views/view_gtk.cc
@@ -4,6 +4,8 @@
#include "views/view.h"
+#include <gtk/gtk.h>
+
#include "base/logging.h"
namespace views {
@@ -27,15 +29,24 @@ void View::Focus() {
}
int View::GetHorizontalDragThreshold() {
- static int threshold = -1;
- NOTIMPLEMENTED();
- return threshold;
+ static bool determined_threshold = false;
+ static int drag_threshold = 8;
+ if (determined_threshold)
+ return drag_threshold;
+ determined_threshold = true;
+ GtkSettings* settings = gtk_settings_get_default();
+ if (!settings)
+ return drag_threshold;
+ int value = 0;
+ g_object_get(G_OBJECT(settings), "gtk-dnd-drag-threshold", &value, NULL);
+ if (value)
+ drag_threshold = value;
+ return drag_threshold;
}
int View::GetVerticalDragThreshold() {
- static int threshold = -1;
- NOTIMPLEMENTED();
- return threshold;
+ // Vertical and horizontal drag threshold are the same in Gtk.
+ return GetHorizontalDragThreshold();
}
} // namespace views