aboutsummaryrefslogtreecommitdiff
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-07-21 11:23:48 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-07-22 23:10:19 +1000
commit9df660ee3188386c907d8feb999636ce8d61d095 (patch)
treeeb9343b66221d664ac995995d7bcceb45d25ee94 /sway/input/seat.c
parent6767d8a593723a9b69d018eed13d24a789be9516 (diff)
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.c12
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) {
return NULL;
}
-void seat_begin_move(struct sway_seat *seat, struct sway_container *con) {
+void seat_begin_move(struct sway_seat *seat, struct sway_container *con,
+ uint32_t button) {
if (!seat->cursor) {
wlr_log(WLR_DEBUG, "Ignoring move request due to no cursor device");
return;
}
seat->operation = OP_MOVE;
seat->op_container = con;
- seat->op_button = BTN_LEFT;
+ seat->op_button = button;
}
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) {
seat->operation = OP_NONE;
seat->op_container = NULL;
}
+
+void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec,
+ uint32_t button, enum wlr_button_state state) {
+ seat->last_button = button;
+ seat->last_button_serial = wlr_seat_pointer_notify_button(seat->wlr_seat,
+ time_msec, button, state);
+}