[maemo-commits] [maemo-commits] r12574 - in projects/haf/trunk/gtk+: . gtk

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Jun 29 19:03:42 EEST 2007
Author: mitch
Date: 2007-06-29 19:03:32 +0300 (Fri, 29 Jun 2007)
New Revision: 12574

Modified:
   projects/haf/trunk/gtk+/ChangeLog
   projects/haf/trunk/gtk+/gtk/gtkmenu.c
Log:
2007-06-29  Michael Natterer  <mitch at imendio.com>

	* gtk/gtkmenu.c: use gtk-dnd-drag-threshold (which is 30) instead
	of a hardcoded value of 20 pixels when deciding whether to pop
	down context menus when the user drags the stylus outside the
	menu.



Modified: projects/haf/trunk/gtk+/ChangeLog
===================================================================
--- projects/haf/trunk/gtk+/ChangeLog	2007-06-29 16:03:14 UTC (rev 12573)
+++ projects/haf/trunk/gtk+/ChangeLog	2007-06-29 16:03:32 UTC (rev 12574)
@@ -1,3 +1,10 @@
+2007-06-29  Michael Natterer  <mitch at imendio.com>
+
+	* gtk/gtkmenu.c: use gtk-dnd-drag-threshold (which is 30) instead
+	of a hardcoded value of 20 pixels when deciding whether to pop
+	down context menus when the user drags the stylus outside the
+	menu.
+
 2007-06-29  Xan Lopez  <xan.lopez at nokia.com>
 
 	* gtk/gtk.symbols:

Modified: projects/haf/trunk/gtk+/gtk/gtkmenu.c
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtkmenu.c	2007-06-29 16:03:14 UTC (rev 12573)
+++ projects/haf/trunk/gtk+/gtk/gtkmenu.c	2007-06-29 16:03:32 UTC (rev 12574)
@@ -2925,17 +2925,22 @@
           (priv->popup_pointer_x >= 0) &&
           (priv->popup_pointer_y >= 0))
         {
+          gint threshold;
           gint distance;
 
+          g_object_get (gtk_widget_get_settings (widget),
+                        "gtk-dnd-drag-threshold", &threshold,
+                        NULL);
+
           distance = distance_traveled (widget);
 
           priv->popup_pointer_x = -1;
           priv->popup_pointer_y = -1;
 
-          /*  Don't popdown if we traveled less than 20px since popup
-           *  point, as per the Nokia 770 specs.
+          /*  Don't popdown if we traveled less than DND threshold
+           *  since popup point, as per the Nokia 770 specs.
            */
-          if (distance < 20)
+          if (distance < threshold)
             return TRUE;
         }
 
@@ -3189,11 +3194,17 @@
 
       if (priv->context_menu)
         {
+          gint threshold;
+
+          g_object_get (gtk_widget_get_settings (widget),
+                        "gtk-dnd-drag-threshold", &threshold,
+                        NULL);
+
           /* Context menu mode. If we dragged out of the menu, close
            * the menu, as by the specs.
            */
           if (!pointer_in_menu_window (widget, event->x_root, event->y_root) &&
-              (distance_traveled (widget) >= 20) &&
+              (distance_traveled (widget) >= threshold) &&
               (event->state & GDK_BUTTON1_MASK))
             {
               gtk_menu_shell_deactivate (GTK_MENU_SHELL (widget));


More information about the maemo-commits mailing list