diff options
author | Vincent Vanlaer <vincent.vanlaer@skynet.be> | 2018-02-06 13:15:27 +0100 |
---|---|---|
committer | Vincent Vanlaer <vincent.vanlaer@skynet.be> | 2018-02-06 13:57:03 +0100 |
commit | 147e5c0f8f689d052f77bbcffda8e7da41241109 (patch) | |
tree | c36daec622fa556d0efc88982e7a77556e1e76d6 | |
parent | 6567a359034c4a0829711e518fb284c7c5df5d44 (diff) |
Refactor roots_cursor_press_button
Removed the button_count check when resizing/moving/rotating ends,
since all buttons presses are now properly tracked.
-rw-r--r-- | rootston/cursor.c | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/rootston/cursor.c b/rootston/cursor.c index 0b490989..87391e29 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -244,35 +244,29 @@ static void roots_cursor_press_button(struct roots_cursor *cursor, roots_seat_begin_rotate(seat, view); break; } - if (!is_touch) { - wlr_seat_pointer_notify_button(seat->seat, time, button, state); - } - return; - } + } else { - if (view && !surface) { - if (cursor->pointer_view) { - seat_view_deco_button(cursor->pointer_view, sx, sy, button, state); + if (view && !surface) { + if (cursor->pointer_view) { + seat_view_deco_button(cursor->pointer_view, sx, sy, button, state); + } } - } - if (state == WLR_BUTTON_RELEASED && - cursor->mode != ROOTS_CURSOR_PASSTHROUGH) { - cursor->mode = ROOTS_CURSOR_PASSTHROUGH; - if (seat->seat->pointer_state.button_count == 0) { - return; + if (state == WLR_BUTTON_RELEASED && + cursor->mode != ROOTS_CURSOR_PASSTHROUGH) { + cursor->mode = ROOTS_CURSOR_PASSTHROUGH; } - } - switch (state) { - case WLR_BUTTON_RELEASED: - if (!is_touch) { - roots_cursor_update_position(cursor, time); + switch (state) { + case WLR_BUTTON_RELEASED: + if (!is_touch) { + roots_cursor_update_position(cursor, time); + } + break; + case WLR_BUTTON_PRESSED: + roots_seat_set_focus(seat, view); + break; } - break; - case WLR_BUTTON_PRESSED: - roots_seat_set_focus(seat, view); - break; } if (!is_touch) { |