diff options
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 24105130..09c020e9 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -362,7 +362,8 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct | |||
362 | // | 362 | // |
363 | // Since this doesn't currently support moving windows between outputs we | 363 | // Since this doesn't currently support moving windows between outputs we |
364 | // don't do the switch if the pointer is in a mode. | 364 | // don't do the switch if the pointer is in a mode. |
365 | if (config->seamless_mouse && !pointer_state.mode) { | 365 | if (config->seamless_mouse && !pointer_state.mode && |
366 | !pointer_state.left.held && !pointer_state.right.held && !pointer_state.scroll.held) { | ||
366 | swayc_t *output = swayc_active_output(); | 367 | swayc_t *output = swayc_active_output(); |
367 | 368 | ||
368 | // TODO: This implementation is naïve: We assume all outputs are | 369 | // TODO: This implementation is naïve: We assume all outputs are |
@@ -376,8 +377,9 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct | |||
376 | } | 377 | } |
377 | if (c->y == output->y && c->x + c->width == output->x) { | 378 | if (c->y == output->y && c->x + c->width == output->x) { |
378 | sway_log(L_DEBUG, "%s is right of %s", output->name, c->name); | 379 | sway_log(L_DEBUG, "%s is right of %s", output->name, c->name); |
379 | workspace_switch(c); | 380 | if (workspace_switch(c)) { |
380 | new_origin.x = c->width; | 381 | new_origin.x = c->width; |
382 | } | ||
381 | } | 383 | } |
382 | } | 384 | } |
383 | } else if ((double)origin->x == output->width) { // Right edge | 385 | } else if ((double)origin->x == output->width) { // Right edge |
@@ -388,8 +390,9 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct | |||
388 | } | 390 | } |
389 | if (c->y == output->y && output->x + output->width == c->x) { | 391 | if (c->y == output->y && output->x + output->width == c->x) { |
390 | sway_log(L_DEBUG, "%s is left of %s", output->name, c->name); | 392 | sway_log(L_DEBUG, "%s is left of %s", output->name, c->name); |
391 | workspace_switch(c); | 393 | if (workspace_switch(c)) { |
392 | new_origin.x = 0; | 394 | new_origin.x = 0; |
395 | } | ||
393 | } | 396 | } |
394 | } | 397 | } |
395 | } | 398 | } |
@@ -401,8 +404,9 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct | |||
401 | } | 404 | } |
402 | if (output->x == c->x && c->y + c->height == output->y) { | 405 | if (output->x == c->x && c->y + c->height == output->y) { |
403 | sway_log(L_DEBUG, "%s is below %s", output->name, c->name); | 406 | sway_log(L_DEBUG, "%s is below %s", output->name, c->name); |
404 | workspace_switch(c); | 407 | if (workspace_switch(c)) { |
405 | new_origin.y = c->height; | 408 | new_origin.y = c->height; |
409 | } | ||
406 | } | 410 | } |
407 | } | 411 | } |
408 | } else if ((double)origin->y == output->height) { // Bottom edge | 412 | } else if ((double)origin->y == output->height) { // Bottom edge |
@@ -413,8 +417,9 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct | |||
413 | } | 417 | } |
414 | if (output->x == c->x && output->y + output->height == c->y) { | 418 | if (output->x == c->x && output->y + output->height == c->y) { |
415 | sway_log(L_DEBUG, "%s is above %s", output->name, c->name); | 419 | sway_log(L_DEBUG, "%s is above %s", output->name, c->name); |
416 | workspace_switch(c); | 420 | if (workspace_switch(c)) { |
417 | new_origin.y = 0; | 421 | new_origin.y = 0; |
422 | } | ||
418 | } | 423 | } |
419 | } | 424 | } |
420 | } | 425 | } |