diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-10 23:43:31 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-12 10:45:54 +1000 |
commit | 1893515d3a0389bf9c2289b1ae34b3add10225c6 (patch) | |
tree | fe74fe3e7e7d8bf7b6e32278afc3e8f993bfa313 /sway/input/cursor.c | |
parent | Allow resizing tiled views via mod key (diff) | |
download | sway-1893515d3a0389bf9c2289b1ae34b3add10225c6.tar.gz sway-1893515d3a0389bf9c2289b1ae34b3add10225c6.tar.zst sway-1893515d3a0389bf9c2289b1ae34b3add10225c6.zip |
Fix right-click/popups and add state checks
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r-- | sway/input/cursor.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 5f295828..12cca7fd 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -657,7 +657,8 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
657 | } | 657 | } |
658 | 658 | ||
659 | // Handle tiling resize via border | 659 | // Handle tiling resize via border |
660 | if (resize_edge && button == BTN_LEFT && !is_floating) { | 660 | if (resize_edge && button == BTN_LEFT && state == WLR_BUTTON_PRESSED && |
661 | !is_floating) { | ||
661 | seat_set_focus(seat, cont); | 662 | seat_set_focus(seat, cont); |
662 | seat_begin_resize_tiling(seat, cont, button, edge); | 663 | seat_begin_resize_tiling(seat, cont, button, edge); |
663 | return; | 664 | return; |
@@ -666,7 +667,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
666 | // Handle tiling resize via mod | 667 | // Handle tiling resize via mod |
667 | bool mod_pressed = keyboard && | 668 | bool mod_pressed = keyboard && |
668 | (wlr_keyboard_get_modifiers(keyboard) & config->floating_mod); | 669 | (wlr_keyboard_get_modifiers(keyboard) & config->floating_mod); |
669 | if (!is_floating) { | 670 | if (!is_floating && mod_pressed && state == WLR_BUTTON_PRESSED) { |
670 | uint32_t btn_resize = config->floating_mod_inverse ? | 671 | uint32_t btn_resize = config->floating_mod_inverse ? |
671 | BTN_LEFT : BTN_RIGHT; | 672 | BTN_LEFT : BTN_RIGHT; |
672 | if (button == btn_resize) { | 673 | if (button == btn_resize) { |
@@ -682,7 +683,8 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
682 | } | 683 | } |
683 | 684 | ||
684 | // Handle beginning floating move | 685 | // Handle beginning floating move |
685 | if (is_floating_or_child && !is_fullscreen_or_child) { | 686 | if (is_floating_or_child && !is_fullscreen_or_child && |
687 | state == WLR_BUTTON_PRESSED) { | ||
686 | uint32_t btn_move = config->floating_mod_inverse ? BTN_RIGHT : BTN_LEFT; | 688 | uint32_t btn_move = config->floating_mod_inverse ? BTN_RIGHT : BTN_LEFT; |
687 | if (button == btn_move && state == WLR_BUTTON_PRESSED && | 689 | if (button == btn_move && state == WLR_BUTTON_PRESSED && |
688 | (mod_pressed || on_titlebar)) { | 690 | (mod_pressed || on_titlebar)) { |