aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-10-10 13:44:55 +0200
committerGitHub <noreply@github.com>2018-10-10 13:44:55 +0200
commit155e863ead0edca244e4c961ca80418edde81838 (patch)
treec141eefc59a8d3f925d9f195d3fbe1e9db888510 /sway/input
parent87bc707e9b21a6b06c8aec2c0ff1e823abf9bda4 (diff)
parent416bb7a214d6f140a4eb7a1b8b0581fc78d71cda (diff)
downloadsway-155e863ead0edca244e4c961ca80418edde81838.tar.xz
Merge pull request #2811 from RyanDwyer/fix-floating-click-events
Fix floating click events
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/cursor.c1
-rw-r--r--sway/input/seat.c13
2 files changed, 13 insertions, 1 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 6d57c45f..5c446299 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -877,6 +877,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
while (cont->parent) {
cont = cont->parent;
}
+ seat_set_focus_container(seat, cont);
seat_begin_move_floating(seat, cont, button);
return;
}
diff --git a/sway/input/seat.c b/sway/input/seat.c
index f418785d..daf5b160 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -1038,7 +1038,7 @@ void seat_begin_down(struct sway_seat *seat, struct sway_container *con,
seat->op_moved = false;
// In case the container was not raised by gaining focus, raise on click
- if (con && !config->raise_floating) {
+ if (!config->raise_floating) {
container_raise_floating(con);
}
}
@@ -1052,6 +1052,12 @@ void seat_begin_move_floating(struct sway_seat *seat,
seat->operation = OP_MOVE_FLOATING;
seat->op_container = con;
seat->op_button = button;
+
+ // In case the container was not raised by gaining focus, raise on click
+ if (!config->raise_floating) {
+ container_raise_floating(con);
+ }
+
cursor_set_image(seat->cursor, "grab", NULL);
}
@@ -1085,6 +1091,11 @@ void seat_begin_resize_floating(struct sway_seat *seat,
seat->op_ref_con_ly = con->y;
seat->op_ref_width = con->width;
seat->op_ref_height = con->height;
+ //
+ // In case the container was not raised by gaining focus, raise on click
+ if (!config->raise_floating) {
+ container_raise_floating(con);
+ }
const char *image = edge == WLR_EDGE_NONE ?
"se-resize" : wlr_xcursor_get_resize_name(edge);