aboutsummaryrefslogtreecommitdiffstats
path: root/sway/handlers.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/handlers.c')
-rw-r--r--sway/handlers.c20
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
377 } 377 }
378 if (c->y == output->y && c->x + c->width == output->x) { 378 if (c->y == output->y && c->x + c->width == output->x) {
379 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);
380 workspace_switch(c); 380 if (workspace_switch(c)) {
381 new_origin.x = c->width; 381 new_origin.x = c->width;
382 }
382 } 383 }
383 } 384 }
384 } else if ((double)origin->x == output->width) { // Right edge 385 } 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
389 } 390 }
390 if (c->y == output->y && output->x + output->width == c->x) { 391 if (c->y == output->y && output->x + output->width == c->x) {
391 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);
392 workspace_switch(c); 393 if (workspace_switch(c)) {
393 new_origin.x = 0; 394 new_origin.x = 0;
395 }
394 } 396 }
395 } 397 }
396 } 398 }
@@ -402,8 +404,9 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct
402 } 404 }
403 if (output->x == c->x && c->y + c->height == output->y) { 405 if (output->x == c->x && c->y + c->height == output->y) {
404 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);
405 workspace_switch(c); 407 if (workspace_switch(c)) {
406 new_origin.y = c->height; 408 new_origin.y = c->height;
409 }
407 } 410 }
408 } 411 }
409 } else if ((double)origin->y == output->height) { // Bottom edge 412 } 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
414 } 417 }
415 if (output->x == c->x && output->y + output->height == c->y) { 418 if (output->x == c->x && output->y + output->height == c->y) {
416 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);
417 workspace_switch(c); 420 if (workspace_switch(c)) {
418 new_origin.y = 0; 421 new_origin.y = 0;
422 }
419 } 423 }
420 } 424 }
421 } 425 }