aboutsummaryrefslogtreecommitdiff
path: root/sway/handlers.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-09 20:13:22 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-09 20:13:22 -0400
commitba14118f13051ea747c4972ab799f36500109481 (patch)
tree1130feb6ba67195a1fb013e86561d98858f2ed4b /sway/handlers.c
parent9f091c7f82a73144b4eb4ca4f5f800c811fbab46 (diff)
Fix focus follows mouse
Diffstat (limited to 'sway/handlers.c')
-rw-r--r--sway/handlers.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index 70d044b6..7d45452f 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -103,6 +103,7 @@ bool handle_pointer_motion(wlc_handle view, uint32_t time, const struct wlc_orig
swayc_t *focused = get_focused_container(&root_container);
if (c && c != focused) {
sway_log(L_DEBUG, "Switching focus to %p", c);
+ unfocus_all(&root_container);
focus_view(c);
}
return true;
@@ -115,6 +116,7 @@ bool handle_pointer_button(wlc_handle view, uint32_t time, const struct wlc_modi
swayc_t *focused = get_focused_container(&root_container);
if (c && c != focused) {
sway_log(L_DEBUG, "Switching focus to %p", c);
+ unfocus_all(&root_container);
focus_view(c);
return false;
}