update pointer-gestures-unstable-v1 for HEAD

This commit is contained in:
wochap 2024-04-11 18:12:30 -05:00
parent fc4146f306
commit c676de59d5
No known key found for this signature in database
GPG Key ID: FE4CF844E73095E1

View File

@ -1,26 +1,26 @@
From 12e9008e1f9ab82cc5342ab7579859912ed7d1a3 Mon Sep 17 00:00:00 2001
From 5c70217539343573bd4b0b9a15a64d012c74eb01 Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Wed, 6 Mar 2024 07:21:15 -0500
Date: Thu, 11 Apr 2024 14:40:22 -0500
Subject: [PATCH] Implement pointer-gestures-unstable-v1
Forward the following events to client: swipe_begin, swipe_update, swipe_end, pinch_begin, pinch_update and pinch_end
---
dwl.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 103 insertions(+)
dwl.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 104 insertions(+)
diff --git a/dwl.c b/dwl.c
index ef27a1d..2aeaca1 100644
index bf763df..e96ea09 100644
--- a/dwl.c
+++ b/dwl.c
@@ -34,6 +34,7 @@
#include <wlr/types/wlr_output_layout.h>
@@ -36,6 +36,7 @@
#include <wlr/types/wlr_output_management_v1.h>
#include <wlr/types/wlr_pointer.h>
#include <wlr/types/wlr_pointer_constraints_v1.h>
+#include <wlr/types/wlr_pointer_gestures_v1.h>
#include <wlr/types/wlr_presentation_time.h>
#include <wlr/types/wlr_primary_selection.h>
#include <wlr/types/wlr_primary_selection_v1.h>
@@ -235,6 +236,12 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
@@ -248,6 +249,12 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
static void arrangelayers(Monitor *m);
static void axisnotify(struct wl_listener *listener, void *data);
static void buttonpress(struct wl_listener *listener, void *data);
@ -33,15 +33,15 @@ index ef27a1d..2aeaca1 100644
static void chvt(const Arg *arg);
static void checkidleinhibitor(struct wlr_surface *exclude);
static void cleanup(void);
@@ -357,6 +364,7 @@ static struct wlr_output_manager_v1 *output_mgr;
static struct wlr_gamma_control_manager_v1 *gamma_control_mgr;
@@ -378,6 +385,7 @@ static struct wlr_gamma_control_manager_v1 *gamma_control_mgr;
static struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard_mgr;
static struct wlr_virtual_pointer_manager_v1 *virtual_pointer_mgr;
static struct wlr_cursor_shape_manager_v1 *cursor_shape_mgr;
+static struct wlr_pointer_gestures_v1 *pointer_gestures;
static struct wlr_cursor *cursor;
static struct wlr_xcursor_manager *cursor_mgr;
@@ -597,6 +605,94 @@ buttonpress(struct wl_listener *listener, void *data)
static struct wlr_pointer_constraints_v1 *pointer_constraints;
static struct wlr_relative_pointer_manager_v1 *relative_pointer_mgr;
@@ -628,6 +636,94 @@ buttonpress(struct wl_listener *listener, void *data)
event->time_msec, event->button, event->state);
}
@ -136,27 +136,21 @@ index ef27a1d..2aeaca1 100644
void
chvt(const Arg *arg)
{
@@ -2315,6 +2411,12 @@ setup(void)
LISTEN_STATIC(&cursor->events.motion, motionrelative);
LISTEN_STATIC(&cursor->events.motion_absolute, motionabsolute);
LISTEN_STATIC(&cursor->events.button, buttonpress);
@@ -2446,6 +2542,14 @@ setup(void)
virtual_pointer_mgr = wlr_virtual_pointer_manager_v1_create(dpy);
LISTEN_STATIC(&virtual_pointer_mgr->events.new_virtual_pointer, virtualpointer);
+ pointer_gestures = wlr_pointer_gestures_v1_create(dpy);
+ LISTEN_STATIC(&cursor->events.swipe_begin, swipe_begin);
+ LISTEN_STATIC(&cursor->events.swipe_update, swipe_update);
+ LISTEN_STATIC(&cursor->events.swipe_end, swipe_end);
+ LISTEN_STATIC(&cursor->events.pinch_begin, pinch_begin);
+ LISTEN_STATIC(&cursor->events.pinch_update, pinch_update);
+ LISTEN_STATIC(&cursor->events.pinch_end, pinch_end);
LISTEN_STATIC(&cursor->events.axis, axisnotify);
LISTEN_STATIC(&cursor->events.frame, cursorframe);
@@ -2331,6 +2433,7 @@ setup(void)
LISTEN_STATIC(&backend->events.new_input, inputdevice);
virtual_keyboard_mgr = wlr_virtual_keyboard_manager_v1_create(dpy);
LISTEN_STATIC(&virtual_keyboard_mgr->events.new_virtual_keyboard, virtualkeyboard);
+ pointer_gestures = wlr_pointer_gestures_v1_create(dpy);
+
seat = wlr_seat_create(dpy, "seat0");
LISTEN_STATIC(&seat->events.request_set_cursor, setcursor);
LISTEN_STATIC(&seat->events.request_set_selection, setsel);
--
2.42.0
2.43.2