aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2018-12-17 16:51:12 -0500
committerBrian Ashworth <bosrsf04@gmail.com>2018-12-17 16:55:44 -0500
commit0ea54833d4f799363e73526e4e82e257360cbc06 (patch)
tree3f06df32826d9c7edd7ca446a87169a33ca11786
parent0d741782c4451e0cde5ab0b4fa09470000d1ca57 (diff)
Focus node before tiling drag if on titlebar
Before attempting to drag a tiling container by its titlebar, focus it. This fixes clicking on titlebars to focus a container.
-rw-r--r--sway/input/cursor.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 0349fa7c..ad9b9835 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -945,6 +945,10 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
if (config->tiling_drag && (mod_pressed || on_titlebar) &&
state == WLR_BUTTON_PRESSED && !is_floating_or_child &&
cont && !cont->is_fullscreen) {
+ if (on_titlebar) {
+ node = seat_get_focus_inactive(seat, &cont->node);
+ seat_set_focus(seat, node);
+ }
seat_pointer_notify_button(seat, time_msec, button, state);
seat_begin_move_tiling(seat, cont, button);
return;