diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/input/seat.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index 9dfb0714..5c404ecd 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h | |||
@@ -35,6 +35,14 @@ struct sway_drag_icon { | |||
35 | struct wl_listener destroy; | 35 | struct wl_listener destroy; |
36 | }; | 36 | }; |
37 | 37 | ||
38 | enum sway_seat_operation { | ||
39 | OP_NONE, | ||
40 | OP_DOWN, | ||
41 | OP_MOVE, | ||
42 | OP_RESIZE_FLOATING, | ||
43 | OP_RESIZE_TILING, | ||
44 | }; | ||
45 | |||
38 | struct sway_seat { | 46 | struct sway_seat { |
39 | struct wlr_seat *wlr_seat; | 47 | struct wlr_seat *wlr_seat; |
40 | struct sway_cursor *cursor; | 48 | struct sway_cursor *cursor; |
@@ -54,13 +62,7 @@ struct sway_seat { | |||
54 | double touch_x, touch_y; | 62 | double touch_x, touch_y; |
55 | 63 | ||
56 | // Operations (drag and resize) | 64 | // Operations (drag and resize) |
57 | enum { | 65 | enum sway_seat_operation operation; |
58 | OP_NONE, | ||
59 | OP_MOVE, | ||
60 | OP_RESIZE_FLOATING, | ||
61 | OP_RESIZE_TILING, | ||
62 | } operation; | ||
63 | |||
64 | struct sway_container *op_container; | 66 | struct sway_container *op_container; |
65 | enum wlr_edges op_resize_edge; | 67 | enum wlr_edges op_resize_edge; |
66 | uint32_t op_button; | 68 | uint32_t op_button; |
@@ -68,6 +70,7 @@ struct sway_seat { | |||
68 | double op_ref_lx, op_ref_ly; // cursor's x/y at start of op | 70 | double op_ref_lx, op_ref_ly; // cursor's x/y at start of op |
69 | double op_ref_width, op_ref_height; // container's size at start of op | 71 | double op_ref_width, op_ref_height; // container's size at start of op |
70 | double op_ref_con_lx, op_ref_con_ly; // container's x/y at start of op | 72 | double op_ref_con_lx, op_ref_con_ly; // container's x/y at start of op |
73 | bool op_moved; // if the mouse moved during a down op | ||
71 | 74 | ||
72 | uint32_t last_button; | 75 | uint32_t last_button; |
73 | uint32_t last_button_serial; | 76 | uint32_t last_button_serial; |
@@ -157,6 +160,9 @@ bool seat_is_input_allowed(struct sway_seat *seat, struct wlr_surface *surface); | |||
157 | 160 | ||
158 | void drag_icon_update_position(struct sway_drag_icon *icon); | 161 | void drag_icon_update_position(struct sway_drag_icon *icon); |
159 | 162 | ||
163 | void seat_begin_down(struct sway_seat *seat, struct sway_container *con, | ||
164 | uint32_t button, double sx, double sy); | ||
165 | |||
160 | void seat_begin_move(struct sway_seat *seat, struct sway_container *con, | 166 | void seat_begin_move(struct sway_seat *seat, struct sway_container *con, |
161 | uint32_t button); | 167 | uint32_t button); |
162 | 168 | ||