[Debian-on-mobile-maintainers] [Git][DebianOnMobile-team/libhandy-1][debian/master] 4 commits: Rediff patches

Arnaud Ferraris gitlab at salsa.debian.org
Sun Sep 27 16:30:00 BST 2020



Arnaud Ferraris pushed to branch debian/master at Debian On Mobile / libhandy-1


Commits:
3dd2605a by Guido Günther at 2020-09-26T11:18:15+02:00
Rediff patches

- - - - -
774f84dc by Guido Günther at 2020-09-26T11:19:32+02:00
swipe-tracker: Special case dragging from buttons

Backport of upstream commit 52eabe10f52a53794a90921baa78792f99c304a9.

- - - - -
b4638800 by Guido Günther at 2020-09-26T11:19:58+02:00
Document changes and release 1.0.0-2

- - - - -
d9b1213f by Arnaud Ferraris at 2020-09-27T17:27:26+02:00
Merge branch 'swipe-fix' into 'debian/master'

Fix swiping in HdyCarousel for Buttons

See merge request DebianOnMobile-team/libhandy-1!7

- - - - -


4 changed files:

- debian/changelog
- debian/patches/Disable-atk-during-tests.patch
- debian/patches/series
- + debian/patches/swipe-tracker-Special-case-dragging-from-buttons.patch


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+libhandy-1 (1.0.0-2) unstable; urgency=medium
+
+  * Rediff patches
+  * swipe-tracker: Special case dragging from buttons. Backport of upstream
+    commit 52eabe10f52a53794a90921baa78792f99c304a9.
+
+ -- Guido Günther <agx at sigxcpu.org>  Sat, 26 Sep 2020 11:19:44 +0200
+
 libhandy-1 (1.0.0-1) unstable; urgency=medium
 
   * New upstream version


=====================================
debian/patches/Disable-atk-during-tests.patch
=====================================
@@ -11,7 +11,7 @@ Closes: #953971
  1 file changed, 1 insertion(+)
 
 diff --git a/tests/meson.build b/tests/meson.build
-index 72e5e75..124ffff 100644
+index c80e96e..234fea3 100644
 --- a/tests/meson.build
 +++ b/tests/meson.build
 @@ -7,6 +7,7 @@ test_env = [


=====================================
debian/patches/series
=====================================
@@ -1 +1,2 @@
 Disable-atk-during-tests.patch
+swipe-tracker-Special-case-dragging-from-buttons.patch


=====================================
debian/patches/swipe-tracker-Special-case-dragging-from-buttons.patch
=====================================
@@ -0,0 +1,124 @@
+From: Alexander Mikhaylenko <alexm at gnome.org>
+Date: Wed, 23 Sep 2020 13:29:02 +0500
+Subject: swipe-tracker: Special case dragging from buttons
+
+Fixes https://source.puri.sm/Librem5/phosh/-/issues/373
+
+(cherry picked from commit 52eabe10f52a53794a90921baa78792f99c304a9)
+---
+ src/hdy-swipe-tracker.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 64 insertions(+), 2 deletions(-)
+
+diff --git a/src/hdy-swipe-tracker.c b/src/hdy-swipe-tracker.c
+index 0cbf4a4..5b1fc3e 100644
+--- a/src/hdy-swipe-tracker.c
++++ b/src/hdy-swipe-tracker.c
+@@ -59,6 +59,7 @@ struct _HdySwipeTracker
+ 
+   gint start_x;
+   gint start_y;
++  gboolean use_capture_phase;
+ 
+   guint32 prev_time;
+   gdouble velocity;
+@@ -113,6 +114,7 @@ reset (HdySwipeTracker *self)
+ 
+   self->start_x = 0;
+   self->start_y = 0;
++  self->use_capture_phase = FALSE;
+ 
+   self->prev_time = 0;
+   self->velocity = 0;
+@@ -541,6 +543,27 @@ is_window_handle (GtkWidget *widget)
+   return parent == titlebar;
+ }
+ 
++/* HACK: Since we don't have _gtk_widget_consumes_motion(), we can't do a proper
++ * check for whether we can drag from a widget or not. So we trust the widgets
++ * to propagate or stop their events. However, GtkButton stops press events,
++ * making it impossible to drag from it.
++ */
++static gboolean
++should_force_drag (HdySwipeTracker *self,
++                   GtkWidget       *widget)
++{
++  GtkWidget *parent;
++
++  if (!GTK_IS_BUTTON (widget))
++    return FALSE;
++
++  parent = widget;
++  while (parent && !HDY_IS_SWIPEABLE (parent))
++    parent = gtk_widget_get_parent (parent);
++
++  return parent == GTK_WIDGET (self->swipeable);
++}
++
+ static gboolean
+ handle_event_cb (HdySwipeTracker *self,
+                  GdkEvent        *event)
+@@ -553,6 +576,9 @@ handle_event_cb (HdySwipeTracker *self,
+   if (!self->enabled && self->state != HDY_SWIPE_TRACKER_STATE_SCROLLING)
+     return GDK_EVENT_PROPAGATE;
+ 
++  if (self->use_capture_phase)
++    return GDK_EVENT_PROPAGATE;
++
+   if (event->type == GDK_SCROLL)
+     return handle_scroll_event (self, event, FALSE);
+ 
+@@ -592,16 +618,52 @@ captured_event_cb (HdySwipeable *swipeable,
+                    GdkEvent     *event)
+ {
+   HdySwipeTracker *self = hdy_swipeable_get_swipe_tracker (swipeable);
++  GtkWidget *widget;
++  GdkEventSequence *sequence;
++  gboolean retval;
++  GtkEventSequenceState state;
+ 
+   g_assert (HDY_IS_SWIPE_TRACKER (self));
+ 
+   if (!self->enabled && self->state != HDY_SWIPE_TRACKER_STATE_SCROLLING)
+     return GDK_EVENT_PROPAGATE;
+ 
+-  if (event->type != GDK_SCROLL)
++  if (event->type == GDK_SCROLL)
++    return handle_scroll_event (self, event, TRUE);
++
++  if (event->type != GDK_BUTTON_PRESS &&
++      event->type != GDK_BUTTON_RELEASE &&
++      event->type != GDK_MOTION_NOTIFY &&
++      event->type != GDK_TOUCH_BEGIN &&
++      event->type != GDK_TOUCH_END &&
++      event->type != GDK_TOUCH_UPDATE &&
++      event->type != GDK_TOUCH_CANCEL)
++    return GDK_EVENT_PROPAGATE;
++
++  widget = gtk_get_event_widget (event);
++
++  if (!self->use_capture_phase && !should_force_drag (self, widget))
++    return GDK_EVENT_PROPAGATE;
++
++  self->use_capture_phase = TRUE;
++
++  sequence = gdk_event_get_event_sequence (event);
++  retval = gtk_event_controller_handle_event (GTK_EVENT_CONTROLLER (self->touch_gesture), event);
++  state = gtk_gesture_get_sequence_state (self->touch_gesture, sequence);
++
++  if (state == GTK_EVENT_SEQUENCE_DENIED) {
++    gtk_event_controller_reset (GTK_EVENT_CONTROLLER (self->touch_gesture));
+     return GDK_EVENT_PROPAGATE;
++  }
++
++  if (self->state == HDY_SWIPE_TRACKER_STATE_SCROLLING) {
++    return GDK_EVENT_STOP;
++  } else if (self->state == HDY_SWIPE_TRACKER_STATE_FINISHING) {
++    reset (self);
++    return GDK_EVENT_STOP;
++  }
+ 
+-  return handle_scroll_event (self, event, TRUE);
++  return retval;
+ }
+ 
+ static void



View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/libhandy-1/-/compare/a77f981125906f66ec60b79863f9aff76b44cd51...d9b1213f9c964cab24cc96de766b7c10456b5e10

-- 
View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/libhandy-1/-/compare/a77f981125906f66ec60b79863f9aff76b44cd51...d9b1213f9c964cab24cc96de766b7c10456b5e10
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-on-mobile-maintainers/attachments/20200927/85e854a0/attachment-0001.html>


More information about the Debian-on-mobile-maintainers mailing list