diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-21 11:23:48 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-22 23:10:19 +1000 |
commit | 9df660ee3188386c907d8feb999636ce8d61d095 (patch) | |
tree | eb9343b66221d664ac995995d7bcceb45d25ee94 /sway/input/seat.c | |
parent | Prevent re-uploading the same cursor image multiple times (diff) | |
download | sway-9df660ee3188386c907d8feb999636ce8d61d095.tar.gz sway-9df660ee3188386c907d8feb999636ce8d61d095.tar.zst sway-9df660ee3188386c907d8feb999636ce8d61d095.zip |
Store last button and use it when views request to move or resize
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r-- | sway/input/seat.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 3a3350e1..4e803efd 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -901,14 +901,15 @@ struct seat_config *seat_get_config(struct sway_seat *seat) { | |||
901 | return NULL; | 901 | return NULL; |
902 | } | 902 | } |
903 | 903 | ||
904 | void seat_begin_move(struct sway_seat *seat, struct sway_container *con) { | 904 | void seat_begin_move(struct sway_seat *seat, struct sway_container *con, |
905 | uint32_t button) { | ||
905 | if (!seat->cursor) { | 906 | if (!seat->cursor) { |
906 | wlr_log(WLR_DEBUG, "Ignoring move request due to no cursor device"); | 907 | wlr_log(WLR_DEBUG, "Ignoring move request due to no cursor device"); |
907 | return; | 908 | return; |
908 | } | 909 | } |
909 | seat->operation = OP_MOVE; | 910 | seat->operation = OP_MOVE; |
910 | seat->op_container = con; | 911 | seat->op_container = con; |
911 | seat->op_button = BTN_LEFT; | 912 | seat->op_button = button; |
912 | } | 913 | } |
913 | 914 | ||
914 | void seat_begin_resize(struct sway_seat *seat, struct sway_container *con, | 915 | void seat_begin_resize(struct sway_seat *seat, struct sway_container *con, |
@@ -951,3 +952,10 @@ void seat_end_mouse_operation(struct sway_seat *seat) { | |||
951 | seat->operation = OP_NONE; | 952 | seat->operation = OP_NONE; |
952 | seat->op_container = NULL; | 953 | seat->op_container = NULL; |
953 | } | 954 | } |
955 | |||
956 | void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec, | ||
957 | uint32_t button, enum wlr_button_state state) { | ||
958 | seat->last_button = button; | ||
959 | seat->last_button_serial = wlr_seat_pointer_notify_button(seat->wlr_seat, | ||
960 | time_msec, button, state); | ||
961 | } | ||