[sysprof/wip/visualizers] multi-paned: only mark position if sequence is accepted



commit 5adb7d6d2c2213e3571298f14a6bcf54471f4ae9
Author: Christian Hergert <chergert redhat com>
Date:   Fri Sep 30 17:11:29 2016 -0700

    multi-paned: only mark position if sequence is accepted
    
    This fixes a bug where any time we touch the adjacent scrollbar,
    the position of the paned gets set.

 lib/sp-multi-paned.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/lib/sp-multi-paned.c b/lib/sp-multi-paned.c
index 233850e..01d5928 100644
--- a/lib/sp-multi-paned.c
+++ b/lib/sp-multi-paned.c
@@ -1533,6 +1533,20 @@ sp_multi_paned_pan_gesture_drag_begin (SpMultiPaned *self,
           priv->drag_begin = child;
           break;
         }
+    }
+
+  if (priv->drag_begin == NULL)
+    {
+      gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_DENIED);
+      return;
+    }
+
+  for (i = 0; i < priv->children->len; i++)
+    {
+      SpMultiPanedChild *child = &g_array_index (priv->children, SpMultiPanedChild, i);
+
+      if (child->handle == event->any.window)
+        break;
 
       /*
        * We want to make any child before the drag child "sticky" so that it
@@ -1549,12 +1563,6 @@ sp_multi_paned_pan_gesture_drag_begin (SpMultiPaned *self,
         }
     }
 
-  if (priv->drag_begin == NULL)
-    {
-      gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_DENIED);
-      return;
-    }
-
   if (IS_HORIZONTAL (priv->orientation))
     priv->drag_begin_position = priv->drag_begin->alloc.width;
   else


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]