diff options
author | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-10-23 14:32:17 +0200 |
---|---|---|
committer | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-10-23 16:35:48 +0200 |
commit | c1479701dea79aebd2b5fdd83a9b28435f6647fe (patch) | |
tree | 857071bb0f3fe2795eacac82071123bfda1a750b /sway/handlers.c | |
parent | 1f08106b0a006d00e7d74701e4196c1f99e4ac36 (diff) |
seamless_mouse: Move pointer only if successfully changed workspace.
If e.g. a window has a popup open then that will lock the current focus,
making a workspace switch denied.
So don't move the mouse pointer in such cases.
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 5acdd096..09c020e9 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -377,8 +377,9 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct } if (c->y == output->y && c->x + c->width == output->x) { sway_log(L_DEBUG, "%s is right of %s", output->name, c->name); - workspace_switch(c); - new_origin.x = c->width; + if (workspace_switch(c)) { + new_origin.x = c->width; + } } } } else if ((double)origin->x == output->width) { // Right edge @@ -389,8 +390,9 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct } if (c->y == output->y && output->x + output->width == c->x) { sway_log(L_DEBUG, "%s is left of %s", output->name, c->name); - workspace_switch(c); - new_origin.x = 0; + if (workspace_switch(c)) { + new_origin.x = 0; + } } } } @@ -402,8 +404,9 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct } if (output->x == c->x && c->y + c->height == output->y) { sway_log(L_DEBUG, "%s is below %s", output->name, c->name); - workspace_switch(c); - new_origin.y = c->height; + if (workspace_switch(c)) { + new_origin.y = c->height; + } } } } else if ((double)origin->y == output->height) { // Bottom edge @@ -414,8 +417,9 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct } if (output->x == c->x && output->y + output->height == c->y) { sway_log(L_DEBUG, "%s is above %s", output->name, c->name); - workspace_switch(c); - new_origin.y = 0; + if (workspace_switch(c)) { + new_origin.y = 0; + } } } } |