[gnome-builder] multi-paned: apply position_set only when sequence is claimed



commit f388d320fce8beb0ccda3d345ccfc13c0888eacc
Author: Christian Hergert <chergert redhat com>
Date:   Fri Sep 30 17:15:11 2016 -0700

    multi-paned: apply position_set only when sequence is claimed
    
    If we don't claim the sequence, then we shouldn't mark our
    children position as set. Otherwise events near the paned
    handle would lock the position of the child.

 contrib/pnl/pnl-multi-paned.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/contrib/pnl/pnl-multi-paned.c b/contrib/pnl/pnl-multi-paned.c
index e49a911..57523e4 100644
--- a/contrib/pnl/pnl-multi-paned.c
+++ b/contrib/pnl/pnl-multi-paned.c
@@ -1533,6 +1533,20 @@ pnl_multi_paned_pan_gesture_drag_begin (PnlMultiPaned *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++)
+    {
+      PnlMultiPanedChild *child = &g_array_index (priv->children, PnlMultiPanedChild, 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 @@ pnl_multi_paned_pan_gesture_drag_begin (PnlMultiPaned *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]