summaryrefslogtreecommitdiff
path: root/gtk/gtkmain.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2022-01-26 23:37:28 +0000
committerCarlos Garnacho <carlosg@gnome.org>2022-01-26 23:37:28 +0000
commit9a7750e339eb6dc668edb9c30cb3f7688efb2d51 (patch)
treedd90a502ff51a23cb8acfedc12c3101dc31f5e12 /gtk/gtkmain.c
parentd7c4ac7d022c1ee9e37468f6406716c12a6d912f (diff)
parentfe86aa5f6bede676756990c7c6496ef87abf721d (diff)
downloadgtk+-9a7750e339eb6dc668edb9c30cb3f7688efb2d51.tar.gz
Merge branch 'hold-gestures' into 'main'
Add hold gestures See merge request GNOME/gtk!3454
Diffstat (limited to 'gtk/gtkmain.c')
-rw-r--r--gtk/gtkmain.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index bfab35ad61..aa32930242 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -915,6 +915,7 @@ rewrite_event_for_surface (GdkEvent *event,
case GDK_TOUCH_CANCEL:
case GDK_TOUCHPAD_SWIPE:
case GDK_TOUCHPAD_PINCH:
+ case GDK_TOUCHPAD_HOLD:
gdk_event_get_position (event, &x, &y);
gdk_surface_translate_coordinates (gdk_event_get_surface (event), new_surface, &x, &y);
break;
@@ -981,6 +982,14 @@ rewrite_event_for_surface (GdkEvent *event,
dx, dy,
gdk_touchpad_event_get_pinch_scale (event),
gdk_touchpad_event_get_pinch_angle_delta (event));
+ case GDK_TOUCHPAD_HOLD:
+ return gdk_touchpad_event_new_hold (new_surface,
+ gdk_event_get_device (event),
+ gdk_event_get_time (event),
+ gdk_event_get_modifier_state (event),
+ gdk_touchpad_event_get_gesture_phase (event),
+ x, y,
+ gdk_touchpad_event_get_n_fingers (event));
default:
break;
}
@@ -1020,6 +1029,7 @@ rewrite_event_for_grabs (GdkEvent *event)
case GDK_TOUCH_CANCEL:
case GDK_TOUCHPAD_SWIPE:
case GDK_TOUCHPAD_PINCH:
+ case GDK_TOUCHPAD_HOLD:
display = gdk_event_get_display (event);
device = gdk_event_get_device (event);
@@ -1270,6 +1280,7 @@ is_pointing_event (GdkEvent *event)
case GDK_TOUCH_CANCEL:
case GDK_TOUCHPAD_PINCH:
case GDK_TOUCHPAD_SWIPE:
+ case GDK_TOUCHPAD_HOLD:
case GDK_DRAG_ENTER:
case GDK_DRAG_LEAVE:
case GDK_DRAG_MOTION:
@@ -1353,7 +1364,8 @@ handle_pointing_event (GdkEvent *event)
device = gdk_seat_get_pointer (gdk_event_get_seat (event));
}
else if (type == GDK_TOUCHPAD_PINCH ||
- type == GDK_TOUCHPAD_SWIPE)
+ type == GDK_TOUCHPAD_SWIPE ||
+ type == GDK_TOUCHPAD_HOLD)
{
/* Another bit of a kludge, touchpad gesture sequences do not
* reflect on the pointer focus lookup.
@@ -1488,6 +1500,7 @@ handle_pointing_event (GdkEvent *event)
case GDK_SCROLL:
case GDK_TOUCHPAD_PINCH:
case GDK_TOUCHPAD_SWIPE:
+ case GDK_TOUCHPAD_HOLD:
break;
case GDK_GRAB_BROKEN:
if (gdk_grab_broken_event_get_implicit (event))
@@ -1662,6 +1675,7 @@ gtk_main_do_event (GdkEvent *event)
case GDK_TOUCH_CANCEL:
case GDK_TOUCHPAD_SWIPE:
case GDK_TOUCHPAD_PINCH:
+ case GDK_TOUCHPAD_HOLD:
case GDK_PAD_BUTTON_PRESS:
case GDK_PAD_BUTTON_RELEASE:
case GDK_PAD_RING: