Blame SOURCES/0001-gtk3-gtk_gesture_get_point-may-return-false.patch

a9add1
From a645619a5740b1eb43795f07fd80f25e240821b5 Mon Sep 17 00:00:00 2001
a9add1
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
a9add1
Date: Tue, 1 Dec 2015 20:51:06 +0000
a9add1
Subject: [PATCH] gtk3: gtk_gesture_get_point may return false
a9add1
a9add1
(cherry picked from commit 23d5775ecf04c001ecf86b6012aef4d1a3f2f063)
a9add1
a9add1
Change-Id: Ibd175c65babdde48132692fd1979a00929356bb4
a9add1
---
a9add1
 vcl/unx/gtk/window/gtksalframe.cxx | 21 +++++++++++----------
a9add1
 1 file changed, 11 insertions(+), 10 deletions(-)
a9add1
a9add1
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
a9add1
index 616f73f..9e03f14 100644
a9add1
--- a/vcl/unx/gtk/window/gtksalframe.cxx
a9add1
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
a9add1
@@ -3611,22 +3611,23 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame
a9add1
 #if GTK_CHECK_VERSION(3,14,0)
a9add1
 void GtkSalFrame::gestureSwipe(GtkGestureSwipe* gesture, gdouble velocity_x, gdouble velocity_y, gpointer frame)
a9add1
 {
a9add1
-    GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
a9add1
-
a9add1
-    SalSwipeEvent aEvent;
a9add1
-    aEvent.mnVelocityX = velocity_x;
a9add1
-    aEvent.mnVelocityY = velocity_y;
a9add1
-
a9add1
     gdouble x, y;
a9add1
     GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture));
a9add1
     //I feel I want the first point of the sequence, not the last point which
a9add1
     //the docs say this gives, but for the moment assume we start and end
a9add1
     //within the same vcl window
a9add1
-    gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y);
a9add1
-    aEvent.mnX = x;
a9add1
-    aEvent.mnY = y;
a9add1
+    if (gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y))
a9add1
+    {
a9add1
+        GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
a9add1
 
a9add1
-    pThis->CallCallback(SALEVENT_SWIPE, &aEvent);
a9add1
+        SalSwipeEvent aEvent;
a9add1
+        aEvent.mnVelocityX = velocity_x;
a9add1
+        aEvent.mnVelocityY = velocity_y;
a9add1
+        aEvent.mnX = x;
a9add1
+        aEvent.mnY = y;
a9add1
+
a9add1
+        pThis->CallCallback(SALEVENT_SWIPE, &aEvent);
a9add1
+    }
a9add1
 }
a9add1
 
a9add1
 void GtkSalFrame::gestureLongPress(GtkGestureLongPress* gesture, gpointer frame)
a9add1
-- 
a9add1
2.5.0
a9add1