diff options
Diffstat (limited to 'include/sway')
-rw-r--r-- | include/sway/input/cursor.h | 13 | ||||
-rw-r--r-- | include/sway/input/seat.h | 6 | ||||
-rw-r--r-- | include/sway/server.h | 4 |
3 files changed, 22 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 @@ | |||
2 | #define _SWAY_INPUT_CURSOR_H | 2 | #define _SWAY_INPUT_CURSOR_H |
3 | #include <stdbool.h> | 3 | #include <stdbool.h> |
4 | #include <stdint.h> | 4 | #include <stdint.h> |
5 | #include <wlr/types/wlr_pointer_constraints_v1.h> | ||
5 | #include <wlr/types/wlr_surface.h> | 6 | #include <wlr/types/wlr_surface.h> |
6 | #include "sway/input/seat.h" | 7 | #include "sway/input/seat.h" |
7 | 8 | ||
@@ -26,6 +27,9 @@ struct sway_cursor { | |||
26 | struct wlr_surface *image_surface; | 27 | struct wlr_surface *image_surface; |
27 | int hotspot_x, hotspot_y; | 28 | int hotspot_x, hotspot_y; |
28 | 29 | ||
30 | struct wlr_pointer_constraint_v1 *active_constraint; | ||
31 | pixman_region32_t confine; // invalid if active_constraint == NULL | ||
32 | |||
29 | struct wl_listener motion; | 33 | struct wl_listener motion; |
30 | struct wl_listener motion_absolute; | 34 | struct wl_listener motion_absolute; |
31 | struct wl_listener button; | 35 | struct wl_listener button; |
@@ -43,6 +47,8 @@ struct sway_cursor { | |||
43 | 47 | ||
44 | struct wl_listener request_set_cursor; | 48 | struct wl_listener request_set_cursor; |
45 | 49 | ||
50 | struct wl_listener constraint_commit; | ||
51 | |||
46 | struct wl_event_source *hide_source; | 52 | struct wl_event_source *hide_source; |
47 | bool hidden; | 53 | bool hidden; |
48 | 54 | ||
@@ -75,7 +81,8 @@ int cursor_get_timeout(struct sway_cursor *cursor); | |||
75 | * Like cursor_rebase, but also allows focus to change when the cursor enters a | 81 | * Like cursor_rebase, but also allows focus to change when the cursor enters a |
76 | * new container. | 82 | * new container. |
77 | */ | 83 | */ |
78 | void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec); | 84 | void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec, |
85 | struct sway_node *node, struct wlr_surface *surface, double sx, double sy); | ||
79 | 86 | ||
80 | void dispatch_cursor_button(struct sway_cursor *cursor, | 87 | void dispatch_cursor_button(struct sway_cursor *cursor, |
81 | struct wlr_input_device *device, uint32_t time_msec, uint32_t button, | 88 | 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, | |||
97 | void cursor_warp_to_workspace(struct sway_cursor *cursor, | 104 | void cursor_warp_to_workspace(struct sway_cursor *cursor, |
98 | struct sway_workspace *workspace); | 105 | struct sway_workspace *workspace); |
99 | 106 | ||
107 | |||
108 | void sway_cursor_constrain(struct sway_cursor *cursor, | ||
109 | struct wlr_pointer_constraint_v1 *constraint); | ||
110 | |||
100 | uint32_t get_mouse_bindsym(const char *name, char **error); | 111 | uint32_t get_mouse_bindsym(const char *name, char **error); |
101 | 112 | ||
102 | uint32_t get_mouse_bindcode(const char *name, char **error); | 113 | uint32_t get_mouse_bindcode(const char *name, char **error); |
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index ef85b67f..1c9354df 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h | |||
@@ -84,6 +84,12 @@ struct sway_seat { | |||
84 | struct wl_list link; // input_manager::seats | 84 | struct wl_list link; // input_manager::seats |
85 | }; | 85 | }; |
86 | 86 | ||
87 | struct sway_pointer_constraint { | ||
88 | struct wlr_pointer_constraint_v1 *constraint; | ||
89 | |||
90 | struct wl_listener destroy; | ||
91 | }; | ||
92 | |||
87 | struct sway_seat *seat_create(const char *seat_name); | 93 | struct sway_seat *seat_create(const char *seat_name); |
88 | 94 | ||
89 | void seat_destroy(struct sway_seat *seat); | 95 | void seat_destroy(struct sway_seat *seat); |
diff --git a/include/sway/server.h b/include/sway/server.h index 9242ceb7..fa2c6557 100644 --- a/include/sway/server.h +++ b/include/sway/server.h | |||
@@ -61,6 +61,9 @@ struct sway_server { | |||
61 | 61 | ||
62 | struct wlr_presentation *presentation; | 62 | struct wlr_presentation *presentation; |
63 | 63 | ||
64 | struct wlr_pointer_constraints_v1 *pointer_constraints; | ||
65 | struct wl_listener pointer_constraint; | ||
66 | |||
64 | size_t txn_timeout_ms; | 67 | size_t txn_timeout_ms; |
65 | list_t *transactions; | 68 | list_t *transactions; |
66 | list_t *dirty_nodes; | 69 | list_t *dirty_nodes; |
@@ -86,5 +89,6 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data); | |||
86 | #endif | 89 | #endif |
87 | void handle_server_decoration(struct wl_listener *listener, void *data); | 90 | void handle_server_decoration(struct wl_listener *listener, void *data); |
88 | void handle_xdg_decoration(struct wl_listener *listener, void *data); | 91 | void handle_xdg_decoration(struct wl_listener *listener, void *data); |
92 | void handle_pointer_constraint(struct wl_listener *listener, void *data); | ||
89 | 93 | ||
90 | #endif | 94 | #endif |