diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-18 09:29:18 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-18 09:29:18 +1000 |
commit | 07a897b3b797b99022a9dfffffc0af2ff50aea85 (patch) | |
tree | 21f148c0741dc02e9ef6fea0c43af47b48f36098 /sway | |
parent | b637b61a7a25219991280717d9bf8a463ed4d8a8 (diff) | |
download | sway-07a897b3b797b99022a9dfffffc0af2ff50aea85.tar.xz |
Don't send motion if the cursor hasn't moved
Prevents GTK+ comboboxes from immediately closing.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/input/cursor.c | 1 | ||||
-rw-r--r-- | sway/input/seat.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 5a2743e3..37fb203d 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -225,6 +225,7 @@ static void handle_down_motion(struct sway_seat *seat, double sy = seat->op_ref_con_ly + moved_y; wlr_seat_pointer_notify_motion(seat->wlr_seat, time_msec, sx, sy); } + seat->op_moved = true; } static void handle_move_motion(struct sway_seat *seat, 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, seat->op_ref_ly = seat->cursor->cursor->y; seat->op_ref_con_lx = sx; seat->op_ref_con_ly = sy; + seat->op_moved = false; } void seat_begin_move(struct sway_seat *seat, struct sway_container *con, @@ -1034,7 +1035,9 @@ void seat_end_mouse_operation(struct sway_seat *seat) { // during the operation. seat->cursor->previous.x = seat->op_ref_lx; seat->cursor->previous.y = seat->op_ref_ly; - cursor_send_pointer_motion(seat->cursor, 0, true); + if (seat->op_moved) { + cursor_send_pointer_motion(seat->cursor, 0, true); + } } else { cursor_set_image(seat->cursor, "left_ptr", NULL); } |