summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2015-07-09 18:47:02 +0200
committerCarlos Garnacho <carlosg@gnome.org>2015-08-12 23:20:24 +0200
commit6cd45af8b0afb3758df6bc7679b651033b39c9c4 (patch)
tree4295a1d8d4ea29b21a30d81b647d5215e0870fcd
parent5092febaf841939c7b3539ef447f43e1ce464037 (diff)
downloadgtk+-6cd45af8b0afb3758df6bc7679b651033b39c9c4.tar.gz
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.
-rw-r--r--gtk/gtkmain.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 25fef1cfdf..dfb6d9b5e6 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1411,6 +1411,18 @@ rewrite_event_for_window (GdkEvent *event,
new_window,
&event->touch.x, &event->touch.y);
break;
+ case GDK_TOUCHPAD_SWIPE:
+ rewrite_events_translate (event->any.window,
+ new_window,
+ &event->touchpad_swipe.x,
+ &event->touchpad_swipe.y);
+ break;
+ case GDK_TOUCHPAD_PINCH:
+ 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:
@@ -1460,6 +1472,8 @@ rewrite_event_for_grabs (GdkEvent *event)
case GDK_TOUCH_UPDATE:
case GDK_TOUCH_END:
case GDK_TOUCH_CANCEL:
+ case GDK_TOUCHPAD_SWIPE:
+ case GDK_TOUCHPAD_PINCH:
display = gdk_window_get_display (event->any.window);
device = gdk_event_get_device (event);
@@ -1819,6 +1833,8 @@ gtk_main_do_event (GdkEvent *event)
case GDK_TOUCH_UPDATE:
case GDK_TOUCH_END:
case GDK_TOUCH_CANCEL:
+ case GDK_TOUCHPAD_SWIPE:
+ case GDK_TOUCHPAD_PINCH:
if (!_gtk_propagate_captured_event (grab_widget, event, topmost_widget))
gtk_propagate_event (grab_widget, event);
break;