diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-16 09:12:48 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-18 09:18:32 +1000 |
commit | b637b61a7a25219991280717d9bf8a463ed4d8a8 (patch) | |
tree | b8b0d0d5e7a13f354ede4c19746f1ebd6042f8a3 /sway/input/seat.c | |
parent | Implement mousedown operation (diff) | |
download | sway-b637b61a7a25219991280717d9bf8a463ed4d8a8.tar.gz sway-b637b61a7a25219991280717d9bf8a463ed4d8a8.tar.zst sway-b637b61a7a25219991280717d9bf8a463ed4d8a8.zip |
Rename mousedown to down and make seat operation a named enum
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r-- | sway/input/seat.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 045bf91a..cc7c28d8 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -954,9 +954,9 @@ struct seat_config *seat_get_config(struct sway_seat *seat) { | |||
954 | return NULL; | 954 | return NULL; |
955 | } | 955 | } |
956 | 956 | ||
957 | void seat_begin_mousedown(struct sway_seat *seat, struct sway_container *con, | 957 | void seat_begin_down(struct sway_seat *seat, struct sway_container *con, |
958 | uint32_t button, double sx, double sy) { | 958 | uint32_t button, double sx, double sy) { |
959 | seat->operation = OP_MOUSEDOWN; | 959 | seat->operation = OP_DOWN; |
960 | seat->op_container = con; | 960 | seat->op_container = con; |
961 | seat->op_button = button; | 961 | seat->op_button = button; |
962 | seat->op_ref_lx = seat->cursor->cursor->x; | 962 | seat->op_ref_lx = seat->cursor->cursor->x; |
@@ -1018,7 +1018,7 @@ void seat_begin_resize_tiling(struct sway_seat *seat, | |||
1018 | } | 1018 | } |
1019 | 1019 | ||
1020 | void seat_end_mouse_operation(struct sway_seat *seat) { | 1020 | void seat_end_mouse_operation(struct sway_seat *seat) { |
1021 | int operation = seat->operation; | 1021 | enum sway_seat_operation operation = seat->operation; |
1022 | if (seat->operation == OP_MOVE) { | 1022 | if (seat->operation == OP_MOVE) { |
1023 | // We "move" the container to its own location so it discovers its | 1023 | // We "move" the container to its own location so it discovers its |
1024 | // output again. | 1024 | // output again. |
@@ -1027,7 +1027,7 @@ void seat_end_mouse_operation(struct sway_seat *seat) { | |||
1027 | } | 1027 | } |
1028 | seat->operation = OP_NONE; | 1028 | seat->operation = OP_NONE; |
1029 | seat->op_container = NULL; | 1029 | seat->op_container = NULL; |
1030 | if (operation == OP_MOUSEDOWN) { | 1030 | if (operation == OP_DOWN) { |
1031 | // Set the cursor's previous coords to the x/y at the start of the | 1031 | // Set the cursor's previous coords to the x/y at the start of the |
1032 | // operation, so the container change will be detected if using | 1032 | // operation, so the container change will be detected if using |
1033 | // focus_follows_mouse and the cursor moved off the original container | 1033 | // focus_follows_mouse and the cursor moved off the original container |