[libchamplain] Don't think that left+right mouse buttons pressed mean multitouch
- From: Jiří Techet <jiritechet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libchamplain] Don't think that left+right mouse buttons pressed mean multitouch
- Date: Fri, 8 Apr 2016 22:18:47 +0000 (UTC)
commit 99b6263cb91c51d00d04f274e9304de75b706ea3
Author: Jiří Techet <techet gmail com>
Date: Sat Apr 9 00:17:57 2016 +0200
Don't think that left+right mouse buttons pressed mean multitouch
At the moment when both left and right mouse buttons are pressed, they
are regarded as multitouch and start of gesture-based zoom which leads
to strange zooming in/out while holding both mouse buttons and moving the
cursor.
Don't start gesture event when using mouse. (Maybe some of the other
devices might make sense here too but I don't have them to test.
Anyway, mouse is the most common one so this should be OK.)
champlain/champlain-view.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 62c4aa7..f7af4fc 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -1267,8 +1267,11 @@ zoom_gesture_begin_cb (ClutterGestureAction *gesture,
G_GNUC_UNUSED ClutterActor *actor,
G_GNUC_UNUSED gpointer user_data)
{
- /* Give up on >2 finger input */
- return clutter_gesture_action_get_n_current_points (gesture) == 2;
+ ClutterInputDevice *device = clutter_gesture_action_get_device (gesture, 0);
+
+ /* Give up on >2 finger input and when using mouse */
+ return clutter_gesture_action_get_n_current_points (gesture) == 2 &&
+ clutter_input_device_get_device_type (device) != CLUTTER_POINTER_DEVICE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]