aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-08-10 23:43:31 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-08-12 10:45:54 +1000
commit1893515d3a0389bf9c2289b1ae34b3add10225c6 (patch)
treefe74fe3e7e7d8bf7b6e32278afc3e8f993bfa313 /sway/input
parent2dceae6224f38a706182394dc77ebd11afb22531 (diff)
Fix right-click/popups and add state checks
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/cursor.c8
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,
}
// Handle tiling resize via border
- if (resize_edge && button == BTN_LEFT && !is_floating) {
+ if (resize_edge && button == BTN_LEFT && state == WLR_BUTTON_PRESSED &&
+ !is_floating) {
seat_set_focus(seat, cont);
seat_begin_resize_tiling(seat, cont, button, edge);
return;
@@ -666,7 +667,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
// Handle tiling resize via mod
bool mod_pressed = keyboard &&
(wlr_keyboard_get_modifiers(keyboard) & config->floating_mod);
- if (!is_floating) {
+ if (!is_floating && mod_pressed && state == WLR_BUTTON_PRESSED) {
uint32_t btn_resize = config->floating_mod_inverse ?
BTN_LEFT : BTN_RIGHT;
if (button == btn_resize) {
@@ -682,7 +683,8 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
}
// Handle beginning floating move
- if (is_floating_or_child && !is_fullscreen_or_child) {
+ if (is_floating_or_child && !is_fullscreen_or_child &&
+ state == WLR_BUTTON_PRESSED) {
uint32_t btn_move = config->floating_mod_inverse ? BTN_RIGHT : BTN_LEFT;
if (button == btn_move && state == WLR_BUTTON_PRESSED &&
(mod_pressed || on_titlebar)) {