diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-08-18 09:32:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-18 09:32:04 -0400 |
commit | d4a32800d5eb938a769d7802b23f4a0f43cadaef (patch) | |
tree | 3e6b7b1c065ce043fc4f96a5250f88d9bf3d040c /include/sway/input/seat.h | |
parent | 5c779c11f6fc2ca214f64b905086dead170ae174 (diff) | |
parent | 07a897b3b797b99022a9dfffffc0af2ff50aea85 (diff) |
Merge pull request #2460 from RyanDwyer/implement-mousedown
Implement mousedown operation
Diffstat (limited to 'include/sway/input/seat.h')
-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 { struct wl_listener destroy; }; +enum sway_seat_operation { + OP_NONE, + OP_DOWN, + OP_MOVE, + OP_RESIZE_FLOATING, + OP_RESIZE_TILING, +}; + struct sway_seat { struct wlr_seat *wlr_seat; struct sway_cursor *cursor; @@ -54,13 +62,7 @@ struct sway_seat { double touch_x, touch_y; // Operations (drag and resize) - enum { - OP_NONE, - OP_MOVE, - OP_RESIZE_FLOATING, - OP_RESIZE_TILING, - } operation; - + enum sway_seat_operation operation; struct sway_container *op_container; enum wlr_edges op_resize_edge; uint32_t op_button; @@ -68,6 +70,7 @@ struct sway_seat { double op_ref_lx, op_ref_ly; // cursor's x/y at start of op double op_ref_width, op_ref_height; // container's size at start of op double op_ref_con_lx, op_ref_con_ly; // container's x/y at start of op + bool op_moved; // if the mouse moved during a down op uint32_t last_button; uint32_t last_button_serial; @@ -157,6 +160,9 @@ bool seat_is_input_allowed(struct sway_seat *seat, struct wlr_surface *surface); void drag_icon_update_position(struct sway_drag_icon *icon); +void seat_begin_down(struct sway_seat *seat, struct sway_container *con, + uint32_t button, double sx, double sy); + void seat_begin_move(struct sway_seat *seat, struct sway_container *con, uint32_t button); |