diff options
author | 2015-10-29 18:02:02 +0100 | |
---|---|---|
committer | 2015-10-29 18:02:02 +0100 | |
commit | 5ba47d4a44b21500ed3af2670cb1c807b7fed850 (patch) | |
tree | 87858d863df950de9e799149bec84817f1dc3ecc /sway/container.c | |
parent | commands: Learn mouse_warping. (diff) | |
download | sway-5ba47d4a44b21500ed3af2670cb1c807b7fed850.tar.gz sway-5ba47d4a44b21500ed3af2670cb1c807b7fed850.tar.zst sway-5ba47d4a44b21500ed3af2670cb1c807b7fed850.zip |
input_state: Remove mouse_origin (x&y). Query wlc instead.
Diffstat (limited to 'sway/container.c')
-rw-r--r-- | sway/container.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sway/container.c b/sway/container.c index 4f9e2b5e..f3e2b3ae 100644 --- a/sway/container.c +++ b/sway/container.c | |||
@@ -510,7 +510,7 @@ swayc_t *swayc_active_workspace_for(swayc_t *cont) { | |||
510 | } | 510 | } |
511 | 511 | ||
512 | static bool pointer_test(swayc_t *view, void *_origin) { | 512 | static bool pointer_test(swayc_t *view, void *_origin) { |
513 | const struct mouse_origin *origin = _origin; | 513 | const struct wlc_origin *origin = _origin; |
514 | // Determine the output that the view is under | 514 | // Determine the output that the view is under |
515 | swayc_t *parent = swayc_parent_by_type(view, C_OUTPUT); | 515 | swayc_t *parent = swayc_parent_by_type(view, C_OUTPUT); |
516 | if (origin->x >= view->x && origin->y >= view->y | 516 | if (origin->x >= view->x && origin->y >= view->y |
@@ -531,6 +531,8 @@ swayc_t *container_under_pointer(void) { | |||
531 | if (lookup->children == 0) { | 531 | if (lookup->children == 0) { |
532 | return NULL; | 532 | return NULL; |
533 | } | 533 | } |
534 | struct wlc_origin origin; | ||
535 | wlc_pointer_get_origin(&origin); | ||
534 | while (lookup->type != C_VIEW) { | 536 | while (lookup->type != C_VIEW) { |
535 | int i; | 537 | int i; |
536 | int len; | 538 | int len; |
@@ -545,7 +547,7 @@ swayc_t *container_under_pointer(void) { | |||
545 | i = len = lookup->floating->length; | 547 | i = len = lookup->floating->length; |
546 | bool got_floating = false; | 548 | bool got_floating = false; |
547 | while (--i > -1) { | 549 | while (--i > -1) { |
548 | if (pointer_test(lookup->floating->items[i], &pointer_state.origin)) { | 550 | if (pointer_test(lookup->floating->items[i], &origin)) { |
549 | lookup = lookup->floating->items[i]; | 551 | lookup = lookup->floating->items[i]; |
550 | got_floating = true; | 552 | got_floating = true; |
551 | break; | 553 | break; |
@@ -558,7 +560,7 @@ swayc_t *container_under_pointer(void) { | |||
558 | // search children | 560 | // search children |
559 | len = lookup->children->length; | 561 | len = lookup->children->length; |
560 | for (i = 0; i < len; ++i) { | 562 | for (i = 0; i < len; ++i) { |
561 | if (pointer_test(lookup->children->items[i], &pointer_state.origin)) { | 563 | if (pointer_test(lookup->children->items[i], &origin)) { |
562 | lookup = lookup->children->items[i]; | 564 | lookup = lookup->children->items[i]; |
563 | break; | 565 | break; |
564 | } | 566 | } |