From 5adb7d6d2c2213e3571298f14a6bcf54471f4ae9 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 30 Sep 2016 17:11:29 -0700 Subject: [PATCH] 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 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/sp-multi-paned.c b/lib/sp-multi-paned.c index 233850ec..01d59284 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