diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-08-16 21:45:23 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-08-16 21:45:23 -0400 |
commit | 9e56d72e112b20f0d1dc42b377ab9b07816f9d16 (patch) | |
tree | c1c7f522904f6fb0e1c2a081ed7db7840b5e3dad /sway/handlers.c | |
parent | 0de5b535d0d818c1e47bed7111ab88a1c154886a (diff) | |
parent | ffb34583220005889fea117d3b9bc65a4714b6bf (diff) |
Merge pull request #52 from taiyu-len/master
focus changes when mouse moves over border instead of any mouse movement
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 817f197e..0e68a3c8 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -239,10 +239,11 @@ static bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifier static bool handle_pointer_motion(wlc_handle view, uint32_t time, const struct wlc_origin *origin) { mouse_origin = *origin; - if (!config->focus_follows_mouse) { - return false; + static wlc_handle prev_view = -1; + if (config->focus_follows_mouse && prev_view != view) { + focus_pointer(); } - focus_pointer(); + prev_view = view; return false; } |