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 | |
parent | Merge pull request #51 from taiyu-len/master (diff) | |
parent | focus changes when mouse moves over border instead of all mouse movement (diff) | |
download | sway-9e56d72e112b20f0d1dc42b377ab9b07816f9d16.tar.gz sway-9e56d72e112b20f0d1dc42b377ab9b07816f9d16.tar.zst sway-9e56d72e112b20f0d1dc42b377ab9b07816f9d16.zip |
Merge pull request #52 from taiyu-len/master
focus changes when mouse moves over border instead of any mouse movement
-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 | |||
239 | 239 | ||
240 | static bool handle_pointer_motion(wlc_handle view, uint32_t time, const struct wlc_origin *origin) { | 240 | static bool handle_pointer_motion(wlc_handle view, uint32_t time, const struct wlc_origin *origin) { |
241 | mouse_origin = *origin; | 241 | mouse_origin = *origin; |
242 | if (!config->focus_follows_mouse) { | 242 | static wlc_handle prev_view = -1; |
243 | return false; | 243 | if (config->focus_follows_mouse && prev_view != view) { |
244 | focus_pointer(); | ||
244 | } | 245 | } |
245 | focus_pointer(); | 246 | prev_view = view; |
246 | return false; | 247 | return false; |
247 | } | 248 | } |
248 | 249 | ||