aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2018-07-24 18:41:08 -0400
committerBrian Ashworth <bosrsf04@gmail.com>2018-07-24 18:41:08 -0400
commitdca02944ce91feae625e68d897d4caee025f7002 (patch)
tree9a8c70c55a4b210c713d6392805b782fc40742e0 /sway/input
parent817d37c95032946a2e508fcc33cfa5c7ed65cc0d (diff)
downloadsway-dca02944ce91feae625e68d897d4caee025f7002.tar.xz
Implement floating_modifier <mod> [inverse|normal]
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 27597640..9eb11de1 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -449,15 +449,17 @@ static void dispatch_cursor_button_floating(struct sway_cursor *cursor,
bool over_title = edge == WLR_EDGE_NONE && !surface;
// Check for beginning move
- if (button == BTN_LEFT && 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 || over_title)) {
- seat_begin_move(seat, cont, BTN_LEFT);
+ seat_begin_move(seat, cont, btn_move);
return;
}
// Check for beginning resize
bool resizing_via_border = button == BTN_LEFT && edge != WLR_EDGE_NONE;
- bool resizing_via_mod = button == BTN_RIGHT && mod_pressed;
+ uint32_t btn_resize = config->floating_mod_inverse ? BTN_LEFT : BTN_RIGHT;
+ bool resizing_via_mod = button == btn_resize && mod_pressed;
if ((resizing_via_border || resizing_via_mod) &&
state == WLR_BUTTON_PRESSED) {
if (edge == WLR_EDGE_NONE) {