[gtk+/wip/garnacho/touchpad-gestures: 131/141] gtkmain: Handle rewriting of event fields during grabs for touchpad events
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/garnacho/touchpad-gestures: 131/141] gtkmain: Handle rewriting of event fields during grabs for touchpad events
- Date: Mon, 20 Jul 2015 20:16:54 +0000 (UTC)
commit fbc457c55ef8bd2434e86d80ca19c80f6301dac8
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Jul 9 18:47:02 2015 +0200
gtkmain: Handle rewriting of event fields during grabs for touchpad events
The window/coordinates will need translation in the case of touchpad gesture
events, same than with other pointer events.
gtk/gtkmain.c | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 6e5188b..b02ac52 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1400,6 +1400,22 @@ rewrite_event_for_window (GdkEvent *event,
new_window,
&event->touch.x, &event->touch.y);
break;
+ case GDK_TOUCHPAD_SWIPE_BEGIN:
+ case GDK_TOUCHPAD_SWIPE_UPDATE:
+ case GDK_TOUCHPAD_SWIPE_END:
+ rewrite_events_translate (event->any.window,
+ new_window,
+ &event->touchpad_swipe.x,
+ &event->touchpad_swipe.y);
+ break;
+ case GDK_TOUCHPAD_PINCH_BEGIN:
+ case GDK_TOUCHPAD_PINCH_UPDATE:
+ case GDK_TOUCHPAD_PINCH_END:
+ rewrite_events_translate (event->any.window,
+ new_window,
+ &event->touchpad_pinch.x,
+ &event->touchpad_pinch.y);
+ break;
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
case GDK_PROXIMITY_IN:
@@ -1449,6 +1465,12 @@ rewrite_event_for_grabs (GdkEvent *event)
case GDK_TOUCH_UPDATE:
case GDK_TOUCH_END:
case GDK_TOUCH_CANCEL:
+ case GDK_TOUCHPAD_SWIPE_BEGIN:
+ case GDK_TOUCHPAD_SWIPE_UPDATE:
+ case GDK_TOUCHPAD_SWIPE_END:
+ case GDK_TOUCHPAD_PINCH_BEGIN:
+ case GDK_TOUCHPAD_PINCH_UPDATE:
+ case GDK_TOUCHPAD_PINCH_END:
display = gdk_window_get_display (event->any.window);
device = gdk_event_get_device (event);
@@ -1803,6 +1825,14 @@ gtk_main_do_event (GdkEvent *event)
case GDK_TOUCH_UPDATE:
case GDK_TOUCH_END:
case GDK_TOUCH_CANCEL:
+ case GDK_TOUCHPAD_SWIPE_BEGIN:
+ case GDK_TOUCHPAD_SWIPE_UPDATE:
+ case GDK_TOUCHPAD_SWIPE_END:
+ case GDK_TOUCHPAD_SWIPE_CANCEL:
+ case GDK_TOUCHPAD_PINCH_BEGIN:
+ case GDK_TOUCHPAD_PINCH_UPDATE:
+ case GDK_TOUCHPAD_PINCH_END:
+ case GDK_TOUCHPAD_PINCH_CANCEL:
if (!_gtk_propagate_captured_event (grab_widget, event, topmost_widget))
gtk_propagate_event (grab_widget, event);
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]