aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-18 09:29:18 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-18 09:29:18 +1000
commit07a897b3b797b99022a9dfffffc0af2ff50aea85 (patch)
tree21f148c0741dc02e9ef6fea0c43af47b48f36098 /sway/input/seat.c
parentRename mousedown to down and make seat operation a named enum (diff)
downloadsway-07a897b3b797b99022a9dfffffc0af2ff50aea85.tar.gz
sway-07a897b3b797b99022a9dfffffc0af2ff50aea85.tar.zst
sway-07a897b3b797b99022a9dfffffc0af2ff50aea85.zip
Don't send motion if the cursor hasn't moved
Prevents GTK+ comboboxes from immediately closing.
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index cc7c28d8..9d46e760 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -963,6 +963,7 @@ void seat_begin_down(struct sway_seat *seat, struct sway_container *con,
963 seat->op_ref_ly = seat->cursor->cursor->y; 963 seat->op_ref_ly = seat->cursor->cursor->y;
964 seat->op_ref_con_lx = sx; 964 seat->op_ref_con_lx = sx;
965 seat->op_ref_con_ly = sy; 965 seat->op_ref_con_ly = sy;
966 seat->op_moved = false;
966} 967}
967 968
968void seat_begin_move(struct sway_seat *seat, struct sway_container *con, 969void seat_begin_move(struct sway_seat *seat, struct sway_container *con,
@@ -1034,7 +1035,9 @@ void seat_end_mouse_operation(struct sway_seat *seat) {
1034 // during the operation. 1035 // during the operation.
1035 seat->cursor->previous.x = seat->op_ref_lx; 1036 seat->cursor->previous.x = seat->op_ref_lx;
1036 seat->cursor->previous.y = seat->op_ref_ly; 1037 seat->cursor->previous.y = seat->op_ref_ly;
1037 cursor_send_pointer_motion(seat->cursor, 0, true); 1038 if (seat->op_moved) {
1039 cursor_send_pointer_motion(seat->cursor, 0, true);
1040 }
1038 } else { 1041 } else {
1039 cursor_set_image(seat->cursor, "left_ptr", NULL); 1042 cursor_set_image(seat->cursor, "left_ptr", NULL);
1040 } 1043 }