aboutsummaryrefslogtreecommitdiff
path: root/include/sway/input
diff options
context:
space:
mode:
authorStacy Harper <contact@stacyharper.net>2021-08-21 16:04:08 +0200
committerSimon Zeni <simon@bl4ckb0ne.ca>2023-02-20 10:35:10 -0500
commit4666d1785bfb6635e6e8604de383c91714bceebc (patch)
treee940606bd8e735c26b4239342afe88116bf9f457 /include/sway/input
parent7d2e4a51063ac90f950cb44f141ab391cbcaff5f (diff)
Implement seatop_touch
Atm we got issue with the touch position sent to the clients. While holding contact, leaving the initial container will continue to send motion event to the client but with the new local position from the new container. This seatop goal is to send the position of the touch event, relatively to the initial container layout position.
Diffstat (limited to 'include/sway/input')
-rw-r--r--include/sway/input/cursor.h4
-rw-r--r--include/sway/input/seat.h23
2 files changed, 25 insertions, 2 deletions
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h
index 828ac370..4a3774d9 100644
--- a/include/sway/input/cursor.h
+++ b/include/sway/input/cursor.h
@@ -108,6 +108,10 @@ void cursor_unhide(struct sway_cursor *cursor);
int cursor_get_timeout(struct sway_cursor *cursor);
void cursor_notify_key_press(struct sway_cursor *cursor);
+void pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
+ struct wlr_input_device *device, double dx, double dy,
+ double dx_unaccel, double dy_unaccel);
+
void dispatch_cursor_button(struct sway_cursor *cursor,
struct wlr_input_device *device, uint32_t time_msec, uint32_t button,
enum wlr_button_state state);
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index 4abe91f7..227da78b 100644
--- a/include/sway/input/seat.h
+++ b/include/sway/input/seat.h
@@ -4,6 +4,7 @@
#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h>
#include <wlr/types/wlr_layer_shell_v1.h>
#include <wlr/types/wlr_seat.h>
+#include <wlr/types/wlr_touch.h>
#include <wlr/util/edges.h>
#include "sway/config.h"
#include "sway/input/input-manager.h"
@@ -36,6 +37,12 @@ struct sway_seatop_impl {
void (*swipe_end)(struct sway_seat *seat,
struct wlr_pointer_swipe_end_event *event);
void (*rebase)(struct sway_seat *seat, uint32_t time_msec);
+ void (*touch_motion)(struct sway_seat *seat,
+ struct wlr_touch_motion_event *event, double lx, double ly);
+ void (*touch_up)(struct sway_seat *seat,
+ struct wlr_touch_up_event *event);
+ void (*touch_down)(struct sway_seat *seat,
+ struct wlr_touch_down_event *event, double lx, double ly);
void (*tablet_tool_motion)(struct sway_seat *seat,
struct sway_tablet_tool *tool, uint32_t time_msec);
void (*tablet_tool_tip)(struct sway_seat *seat, struct sway_tablet_tool *tool,
@@ -256,10 +263,13 @@ enum wlr_edges find_resize_edge(struct sway_container *cont,
void seatop_begin_default(struct sway_seat *seat);
void seatop_begin_down(struct sway_seat *seat, struct sway_container *con,
- uint32_t time_msec, double sx, double sy);
+ double sx, double sy);
void seatop_begin_down_on_surface(struct sway_seat *seat,
- struct wlr_surface *surface, uint32_t time_msec, double sx, double sy);
+ struct wlr_surface *surface, double sx, double sy);
+
+void seatop_begin_touch_down(struct sway_seat *seat, struct wlr_surface *surface,
+ struct wlr_touch_down_event *event, double sx, double sy, double lx, double ly);
void seatop_begin_move_floating(struct sway_seat *seat,
struct sway_container *con);
@@ -319,6 +329,15 @@ void seatop_swipe_update(struct sway_seat *seat,
void seatop_swipe_end(struct sway_seat *seat,
struct wlr_pointer_swipe_end_event *event);
+void seatop_touch_motion(struct sway_seat *seat,
+ struct wlr_touch_motion_event *event, double lx, double ly);
+
+void seatop_touch_up(struct sway_seat *seat,
+ struct wlr_touch_up_event *event);
+
+void seatop_touch_down(struct sway_seat *seat,
+ struct wlr_touch_down_event *event, double lx, double ly);
+
void seatop_rebase(struct sway_seat *seat, uint32_t time_msec);
/**