diff options
author | Drew DeVault <ddevault@linode.com> | 2015-10-22 16:44:29 -0400 |
---|---|---|
committer | Drew DeVault <ddevault@linode.com> | 2015-10-22 16:44:29 -0400 |
commit | 2c100105bf608d2a0c319c7fd67b319c86852270 (patch) | |
tree | a691d7613bc9f19874f848cc5e2391a36e6cec04 | |
parent | Merge pull request #199 from sce/mouse_cross_output_edge_simple (diff) | |
download | sway-2c100105bf608d2a0c319c7fd67b319c86852270.tar.gz sway-2c100105bf608d2a0c319c7fd67b319c86852270.tar.zst sway-2c100105bf608d2a0c319c7fd67b319c86852270.zip |
Move pointer during seamless transitions
-rw-r--r-- | sway/handlers.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 351d0a0f..6d3f48aa 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -353,6 +353,7 @@ static bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifier | |||
353 | } | 353 | } |
354 | 354 | ||
355 | static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct wlc_origin *origin) { | 355 | static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct wlc_origin *origin) { |
356 | struct wlc_origin new_origin = *origin; | ||
356 | // Switch to adjacent output if touching output edge. | 357 | // Switch to adjacent output if touching output edge. |
357 | // | 358 | // |
358 | // Since this doesn't currently support moving windows between outputs we | 359 | // Since this doesn't currently support moving windows between outputs we |
@@ -372,6 +373,7 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct | |||
372 | if (c->y == output->y && c->x + c->width == output->x) { | 373 | if (c->y == output->y && c->x + c->width == output->x) { |
373 | sway_log(L_DEBUG, "%s is right of %s", output->name, c->name); | 374 | sway_log(L_DEBUG, "%s is right of %s", output->name, c->name); |
374 | workspace_switch(c); | 375 | workspace_switch(c); |
376 | new_origin.x = c->width; | ||
375 | } | 377 | } |
376 | } | 378 | } |
377 | } else if ((double)origin->x == output->width) { // Right edge | 379 | } else if ((double)origin->x == output->width) { // Right edge |
@@ -383,6 +385,7 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct | |||
383 | if (c->y == output->y && output->x + output->width == c->x) { | 385 | if (c->y == output->y && output->x + output->width == c->x) { |
384 | sway_log(L_DEBUG, "%s is left of %s", output->name, c->name); | 386 | sway_log(L_DEBUG, "%s is left of %s", output->name, c->name); |
385 | workspace_switch(c); | 387 | workspace_switch(c); |
388 | new_origin.x = 0; | ||
386 | } | 389 | } |
387 | } | 390 | } |
388 | } | 391 | } |
@@ -395,6 +398,7 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct | |||
395 | if (output->x == c->x && c->y + c->height == output->y) { | 398 | if (output->x == c->x && c->y + c->height == output->y) { |
396 | sway_log(L_DEBUG, "%s is below %s", output->name, c->name); | 399 | sway_log(L_DEBUG, "%s is below %s", output->name, c->name); |
397 | workspace_switch(c); | 400 | workspace_switch(c); |
401 | new_origin.y = 0; | ||
398 | } | 402 | } |
399 | } | 403 | } |
400 | } else if ((double)origin->y == output->height) { // Bottom edge | 404 | } else if ((double)origin->y == output->height) { // Bottom edge |
@@ -406,6 +410,7 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct | |||
406 | if (output->x == c->x && output->y + output->height == c->y) { | 410 | if (output->x == c->x && output->y + output->height == c->y) { |
407 | sway_log(L_DEBUG, "%s is above %s", output->name, c->name); | 411 | sway_log(L_DEBUG, "%s is above %s", output->name, c->name); |
408 | workspace_switch(c); | 412 | workspace_switch(c); |
413 | new_origin.y = c->height; | ||
409 | } | 414 | } |
410 | } | 415 | } |
411 | } | 416 | } |
@@ -431,6 +436,7 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct | |||
431 | set_focused_container(pointer_state.view); | 436 | set_focused_container(pointer_state.view); |
432 | } | 437 | } |
433 | } | 438 | } |
439 | wlc_pointer_set_origin(new_origin); | ||
434 | return EVENT_PASSTHROUGH; | 440 | return EVENT_PASSTHROUGH; |
435 | } | 441 | } |
436 | 442 | ||