aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/input/seat.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway/input/seat.h')
-rw-r--r--include/sway/input/seat.h43
1 files changed, 31 insertions, 12 deletions
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index 0e440701..ab25788f 100644
--- a/include/sway/input/seat.h
+++ b/include/sway/input/seat.h
@@ -3,6 +3,7 @@
3 3
4#include <wlr/types/wlr_layer_shell.h> 4#include <wlr/types/wlr_layer_shell.h>
5#include <wlr/types/wlr_seat.h> 5#include <wlr/types/wlr_seat.h>
6#include <wlr/util/edges.h>
6#include "sway/input/input-manager.h" 7#include "sway/input/input-manager.h"
7 8
8struct sway_seat_device { 9struct sway_seat_device {
@@ -52,6 +53,24 @@ struct sway_seat {
52 int32_t touch_id; 53 int32_t touch_id;
53 double touch_x, touch_y; 54 double touch_x, touch_y;
54 55
56 // Operations (drag and resize)
57 enum {
58 OP_NONE,
59 OP_MOVE,
60 OP_RESIZE,
61 } operation;
62
63 struct sway_container *op_container;
64 enum wlr_edges op_resize_edge;
65 uint32_t op_button;
66 bool op_resize_preserve_ratio;
67 double op_ref_lx, op_ref_ly; // cursor's x/y at start of op
68 double op_ref_width, op_ref_height; // container's size at start of op
69 double op_ref_con_lx, op_ref_con_ly; // container's x/y at start of op
70
71 uint32_t last_button;
72 uint32_t last_button_serial;
73
55 struct wl_listener focus_destroy; 74 struct wl_listener focus_destroy;
56 struct wl_listener new_container; 75 struct wl_listener new_container;
57 struct wl_listener new_drag_icon; 76 struct wl_listener new_drag_icon;
@@ -83,7 +102,7 @@ void seat_set_focus_warp(struct sway_seat *seat,
83 struct sway_container *container, bool warp); 102 struct sway_container *container, bool warp);
84 103
85void seat_set_focus_surface(struct sway_seat *seat, 104void seat_set_focus_surface(struct sway_seat *seat,
86 struct wlr_surface *surface); 105 struct wlr_surface *surface, bool unfocus);
87 106
88void seat_set_focus_layer(struct sway_seat *seat, 107void seat_set_focus_layer(struct sway_seat *seat,
89 struct wlr_layer_surface *layer); 108 struct wlr_layer_surface *layer);
@@ -119,17 +138,6 @@ struct sway_container *seat_get_active_child(struct sway_seat *seat,
119 struct sway_container *container); 138 struct sway_container *container);
120 139
121/** 140/**
122 * Return the immediate child of container which was most recently focused, with
123 * fallback to selecting the child in the parent's `current` (rendered) children
124 * list.
125 *
126 * This is useful for when a tabbed container and its children are destroyed but
127 * still being rendered, and we have to render an appropriate child.
128 */
129struct sway_container *seat_get_active_current_child(struct sway_seat *seat,
130 struct sway_container *container);
131
132/**
133 * Iterate over the focus-inactive children of the container calling the 141 * Iterate over the focus-inactive children of the container calling the
134 * function on each. 142 * function on each.
135 */ 143 */
@@ -145,4 +153,15 @@ bool seat_is_input_allowed(struct sway_seat *seat, struct wlr_surface *surface);
145 153
146void drag_icon_update_position(struct sway_drag_icon *icon); 154void drag_icon_update_position(struct sway_drag_icon *icon);
147 155
156void seat_begin_move(struct sway_seat *seat, struct sway_container *con,
157 uint32_t button);
158
159void seat_begin_resize(struct sway_seat *seat, struct sway_container *con,
160 uint32_t button, enum wlr_edges edge);
161
162void seat_end_mouse_operation(struct sway_seat *seat);
163
164void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec,
165 uint32_t button, enum wlr_button_state state);
166
148#endif 167#endif