Added code to sync the gtk dnd threshold with the panning threshold.
authorAlejandro G. Castro <alex@igalia.com>
Fri, 22 May 2009 09:22:03 +0000 (11:22 +0200)
committerAlejandro G. Castro <alex@igalia.com>
Mon, 25 May 2009 17:38:44 +0000 (19:38 +0200)
* hildon/hildon-pannable-area.c,
(hildon_pannable_area_set_property): Added code to sync the gtk
dnd threshold with the panning threshold.

ChangeLog
hildon/hildon-pannable-area.c

index c81e175..3f35ecd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
 2009-05-25  Alejandro G. Castro  <alex@igalia.com>
 
        * hildon/hildon-pannable-area.c,
+       (hildon_pannable_area_set_property): Added code to sync the gtk
+       dnd threshold with the panning threshold.
+
+2009-05-25  Alejandro G. Castro  <alex@igalia.com>
+
+       * hildon/hildon-pannable-area.c,
        (hildon_pannable_area_class_init): Changed some of the default
        values, now it should be less responsive and more accurate.
 
index 450b2fa..230f4c7 100644 (file)
@@ -824,7 +824,20 @@ hildon_pannable_area_set_property (GObject * object,
     priv->sps = g_value_get_uint (value);
     break;
   case PROP_PANNING_THRESHOLD:
-    priv->panning_threshold = g_value_get_uint (value);
+    {
+      GtkSettings *settings = gtk_settings_get_default ();
+      GtkSettingsValue svalue = { NULL, { 0, }, };
+
+      priv->panning_threshold = g_value_get_uint (value);
+
+      /* insure gtk dnd is the same we are using, not allowed
+         different thresholds in the same application */
+      svalue.origin = "panning_threshold";
+      g_value_init (&svalue.value, G_TYPE_LONG);
+      g_value_set_long (&svalue.value, priv->panning_threshold);
+      gtk_settings_set_property_value (settings, "gtk-dnd-drag-threshold", &svalue);
+      g_value_unset (&svalue.value);
+    }
     break;
   case PROP_SCROLLBAR_FADE_DELAY:
     /* convert to miliseconds */