aboutsummaryrefslogtreecommitdiff
path: root/include/sway/input/cursor.h
diff options
context:
space:
mode:
authorLas <las@protonmail.ch>2019-01-26 00:45:06 +0100
committeremersion <contact@emersion.fr>2019-01-30 19:53:59 +0100
commitcedde21c967ae5be0d1a9c7656ab8c6b3186ae42 (patch)
tree26c784ea3d6546d762a96b131a2cf23cee9a9c38 /include/sway/input/cursor.h
parent5cb3d4769cb055f542e6cb5fc979dd8f0fb9a8f3 (diff)
Implement pointer-constraints-unstable-v1
Diffstat (limited to 'include/sway/input/cursor.h')
-rw-r--r--include/sway/input/cursor.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h
index c87d8332..072a56ca 100644
--- a/include/sway/input/cursor.h
+++ b/include/sway/input/cursor.h
@@ -2,6 +2,7 @@
#define _SWAY_INPUT_CURSOR_H
#include <stdbool.h>
#include <stdint.h>
+#include <wlr/types/wlr_pointer_constraints_v1.h>
#include <wlr/types/wlr_surface.h>
#include "sway/input/seat.h"
@@ -26,6 +27,9 @@ struct sway_cursor {
struct wlr_surface *image_surface;
int hotspot_x, hotspot_y;
+ struct wlr_pointer_constraint_v1 *active_constraint;
+ pixman_region32_t confine; // invalid if active_constraint == NULL
+
struct wl_listener motion;
struct wl_listener motion_absolute;
struct wl_listener button;
@@ -43,6 +47,8 @@ struct sway_cursor {
struct wl_listener request_set_cursor;
+ struct wl_listener constraint_commit;
+
struct wl_event_source *hide_source;
bool hidden;
@@ -75,7 +81,8 @@ int cursor_get_timeout(struct sway_cursor *cursor);
* Like cursor_rebase, but also allows focus to change when the cursor enters a
* new container.
*/
-void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec);
+void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
+ struct sway_node *node, struct wlr_surface *surface, double sx, double sy);
void dispatch_cursor_button(struct sway_cursor *cursor,
struct wlr_input_device *device, uint32_t time_msec, uint32_t button,
@@ -97,6 +104,10 @@ void cursor_warp_to_container(struct sway_cursor *cursor,
void cursor_warp_to_workspace(struct sway_cursor *cursor,
struct sway_workspace *workspace);
+
+void sway_cursor_constrain(struct sway_cursor *cursor,
+ struct wlr_pointer_constraint_v1 *constraint);
+
uint32_t get_mouse_bindsym(const char *name, char **error);
uint32_t get_mouse_bindcode(const char *name, char **error);