[gnome-photos] preview-nav-buttons: Ignore motion events coming from touchscreens



commit 96ebd6499e0a7700f713bdce3f77963fa3771340
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Feb 28 19:15:21 2015 +0100

    preview-nav-buttons: Ignore motion events coming from touchscreens
    
    In future, the underlying view widget will use gestures for zooming,
    rotation, etc.. Therefore we should not reveal the overlaid controls
    when a user is moving her fingers across the touchscreen.

 src/photos-preview-nav-buttons.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-preview-nav-buttons.c b/src/photos-preview-nav-buttons.c
index fafee94..5d2dd80 100644
--- a/src/photos-preview-nav-buttons.c
+++ b/src/photos-preview-nav-buttons.c
@@ -1,6 +1,6 @@
 /*
  * Photos - access, organize and share your photos on GNOME
- * Copyright © 2013, 2014 Red Hat, Inc.
+ * Copyright © 2013, 2014, 2015 Red Hat, Inc.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -214,13 +214,20 @@ photos_preview_nav_buttons_motion_notify_timeout (PhotosPreviewNavButtons *self)
 
 
 static gboolean
-photos_preview_nav_buttons_motion_notify (PhotosPreviewNavButtons *self)
+photos_preview_nav_buttons_motion_notify (PhotosPreviewNavButtons *self, GdkEventMotion *event)
 {
   PhotosPreviewNavButtonsPrivate *priv = self->priv;
+  GdkDevice *device;
+  GdkInputSource input_source;
 
   if (priv->motion_id != 0)
     return FALSE;
 
+  device = gdk_event_get_source_device ((GdkEvent *) event);
+  input_source = gdk_device_get_source (device);
+  if (input_source == GDK_SOURCE_TOUCHSCREEN)
+    return FALSE;
+
   priv->motion_id = g_idle_add_full (G_PRIORITY_DEFAULT,
                                      (GSourceFunc) photos_preview_nav_buttons_motion_notify_timeout,
                                      g_object_ref (self),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]