mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-11-05 06:24:28 +00:00
add hold events
This commit is contained in:
parent
f19182bd0f
commit
05dbce217b
@ -1,14 +1,14 @@
|
||||
From 722db199dcf089ed44590413031cefb4cac4da40 Mon Sep 17 00:00:00 2001
|
||||
From be7e98d28fc59aab67026e7d5efdcaeb26029713 Mon Sep 17 00:00:00 2001
|
||||
From: wochap <gean.marroquin@gmail.com>
|
||||
Date: Fri, 5 Jul 2024 10:56:28 -0500
|
||||
Date: Fri, 12 Jul 2024 11:30:17 -0500
|
||||
Subject: [PATCH] implement pointer-gestures-unstable-v1
|
||||
|
||||
---
|
||||
dwl.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 104 insertions(+)
|
||||
dwl.c | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 136 insertions(+)
|
||||
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index dc0437e..ded83e2 100644
|
||||
index dc0437e..e5805b1 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -38,6 +38,7 @@
|
||||
@ -19,7 +19,7 @@ index dc0437e..ded83e2 100644
|
||||
#include <wlr/types/wlr_presentation_time.h>
|
||||
#include <wlr/types/wlr_primary_selection.h>
|
||||
#include <wlr/types/wlr_primary_selection_v1.h>
|
||||
@@ -250,6 +251,12 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
|
||||
@@ -250,6 +251,14 @@ 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);
|
||||
@ -29,10 +29,12 @@ index dc0437e..ded83e2 100644
|
||||
+static void pinch_begin(struct wl_listener *listener, void *data);
|
||||
+static void pinch_update(struct wl_listener *listener, void *data);
|
||||
+static void pinch_end(struct wl_listener *listener, void *data);
|
||||
+static void hold_begin(struct wl_listener *listener, void *data);
|
||||
+static void hold_end(struct wl_listener *listener, void *data);
|
||||
static void chvt(const Arg *arg);
|
||||
static void checkidleinhibitor(struct wlr_surface *exclude);
|
||||
static void cleanup(void);
|
||||
@@ -383,6 +390,7 @@ static struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard_mgr;
|
||||
@@ -383,6 +392,7 @@ 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_output_power_manager_v1 *power_mgr;
|
||||
@ -40,7 +42,7 @@ index dc0437e..ded83e2 100644
|
||||
|
||||
static struct wlr_pointer_constraints_v1 *pointer_constraints;
|
||||
static struct wlr_relative_pointer_manager_v1 *relative_pointer_mgr;
|
||||
@@ -644,6 +652,94 @@ buttonpress(struct wl_listener *listener, void *data)
|
||||
@@ -644,6 +654,122 @@ buttonpress(struct wl_listener *listener, void *data)
|
||||
event->time_msec, event->button, event->state);
|
||||
}
|
||||
|
||||
@ -131,11 +133,39 @@ index dc0437e..ded83e2 100644
|
||||
+ event->cancelled
|
||||
+ );
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+hold_begin(struct wl_listener *listener, void *data)
|
||||
+{
|
||||
+ struct wlr_pointer_hold_begin_event *event = data;
|
||||
+
|
||||
+ // Forward hold begin event to client
|
||||
+ wlr_pointer_gestures_v1_send_hold_begin(
|
||||
+ pointer_gestures,
|
||||
+ seat,
|
||||
+ event->time_msec,
|
||||
+ event->fingers
|
||||
+ );
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+hold_end(struct wl_listener *listener, void *data)
|
||||
+{
|
||||
+ struct wlr_pointer_hold_end_event *event = data;
|
||||
+
|
||||
+ // Forward hold end event to client
|
||||
+ wlr_pointer_gestures_v1_send_hold_end(
|
||||
+ pointer_gestures,
|
||||
+ seat,
|
||||
+ event->time_msec,
|
||||
+ event->cancelled
|
||||
+ );
|
||||
+}
|
||||
+
|
||||
void
|
||||
chvt(const Arg *arg)
|
||||
{
|
||||
@@ -2556,6 +2652,14 @@ setup(void)
|
||||
@@ -2556,6 +2682,16 @@ setup(void)
|
||||
virtual_pointer_mgr = wlr_virtual_pointer_manager_v1_create(dpy);
|
||||
LISTEN_STATIC(&virtual_pointer_mgr->events.new_virtual_pointer, virtualpointer);
|
||||
|
||||
@ -146,6 +176,8 @@ index dc0437e..ded83e2 100644
|
||||
+ 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.hold_begin, hold_begin);
|
||||
+ LISTEN_STATIC(&cursor->events.hold_end, hold_end);
|
||||
+
|
||||
seat = wlr_seat_create(dpy, "seat0");
|
||||
LISTEN_STATIC(&seat->events.request_set_cursor, setcursor);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user