summaryrefslogtreecommitdiff
path: root/include/sway/input/seat.h
diff options
context:
space:
mode:
authorReza Jelveh <[email protected]>2024-04-15 13:39:41 +0800
committerGitHub <[email protected]>2024-04-15 01:39:41 -0400
commitfb86ed6b0588dfdebfb66ce875bc63cfa0a897f6 (patch)
tree29857a1769107adc58696f08d379f608aa4e29a2 /include/sway/input/seat.h
parenta5e79676c4bd22fc5902182acf0667907202a465 (diff)
feat: 1.9 merge (#277)
Co-authored-by: William McKinnon <[email protected]> Co-authored-by: Erik Reider <[email protected]>
Diffstat (limited to 'include/sway/input/seat.h')
-rw-r--r--include/sway/input/seat.h42
1 files changed, 35 insertions, 7 deletions
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index e3a46872..6063ead3 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"
@@ -11,6 +12,7 @@
#include "sway/input/text_input.h"
struct sway_seat;
+struct fx_render_context;
struct sway_seatop_impl {
void (*button)(struct sway_seat *seat, uint32_t time_msec,
@@ -36,14 +38,21 @@ 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 (*touch_cancel)(struct sway_seat *seat,
+ struct wlr_touch_cancel_event *event);
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,
uint32_t time_msec, enum wlr_tablet_tool_tip_state state);
void (*end)(struct sway_seat *seat);
void (*unref)(struct sway_seat *seat, struct sway_container *con);
- void (*render)(struct sway_seat *seat, struct sway_output *output,
- pixman_region32_t *damage);
+ void (*render)(struct sway_seat *seat, struct fx_render_context *ctx);
bool allow_set_cursor;
};
@@ -72,6 +81,7 @@ struct sway_drag_icon {
struct wl_list link; // sway_root::drag_icons
double x, y; // in layout-local coordinates
+ int dx, dy; // offset in surface-local coordinates
struct wl_listener surface_commit;
struct wl_listener map;
@@ -94,8 +104,9 @@ struct sway_seat {
struct sway_workspace *workspace;
char *prev_workspace_name; // for workspace back_and_forth
- // If the focused layer is set, views cannot receive keyboard focus
struct wlr_layer_surface_v1 *focused_layer;
+ // If the exclusive layer is set, views cannot receive keyboard focus
+ bool has_exclusive_layer;
// If exclusive_client is set, no other clients will receive input events
struct wl_client *exclusive_client;
@@ -157,6 +168,9 @@ void seat_add_device(struct sway_seat *seat,
void seat_configure_device(struct sway_seat *seat,
struct sway_input_device *device);
+void seat_configure_device_mapping(struct sway_seat *seat,
+ struct sway_input_device *input_device);
+
void seat_reset_device(struct sway_seat *seat,
struct sway_input_device *input_device);
@@ -255,10 +269,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);
@@ -318,6 +335,18 @@ 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_touch_cancel(struct sway_seat *seat,
+ struct wlr_touch_cancel_event *event);
+
void seatop_rebase(struct sway_seat *seat, uint32_t time_msec);
/**
@@ -336,8 +365,7 @@ void seatop_unref(struct sway_seat *seat, struct sway_container *con);
* Instructs a seatop to render anything that it needs to render
* (eg. dropzone for move-tiling)
*/
-void seatop_render(struct sway_seat *seat, struct sway_output *output,
- pixman_region32_t *damage);
+void seatop_render(struct sway_seat *seat, struct fx_render_context *ctx);
bool seatop_allows_set_cursor(struct sway_seat *seat);