aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-08 22:14:11 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-08 22:28:13 +1000
commita0ece6f95620674514da633584ebdadabf5b4072 (patch)
treeb1884adab12286ff5c4d482fcfbe68d87313f5fe /sway/tree/container.c
parentFix focus when clicking floating decorations (diff)
downloadsway-a0ece6f95620674514da633584ebdadabf5b4072.tar.gz
sway-a0ece6f95620674514da633584ebdadabf5b4072.tar.zst
sway-a0ece6f95620674514da633584ebdadabf5b4072.zip
Rename container_at_view to surface_at_view and make it return void
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 39df86a5..aecb2ac6 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -533,11 +533,10 @@ struct sway_container *container_parent(struct sway_container *container,
533 return container; 533 return container;
534} 534}
535 535
536static struct sway_container *container_at_view(struct sway_container *swayc, 536static void surface_at_view(struct sway_container *swayc, double lx, double ly,
537 double lx, double ly,
538 struct wlr_surface **surface, double *sx, double *sy) { 537 struct wlr_surface **surface, double *sx, double *sy) {
539 if (!sway_assert(swayc->type == C_VIEW, "Expected a view")) { 538 if (!sway_assert(swayc->type == C_VIEW, "Expected a view")) {
540 return NULL; 539 return;
541 } 540 }
542 struct sway_view *sview = swayc->sway_view; 541 struct sway_view *sview = swayc->sway_view;
543 double view_sx = lx - sview->x; 542 double view_sx = lx - sview->x;
@@ -568,7 +567,6 @@ static struct sway_container *container_at_view(struct sway_container *swayc,
568 *sy = _sy; 567 *sy = _sy;
569 *surface = _surface; 568 *surface = _surface;
570 } 569 }
571 return swayc;
572} 570}
573 571
574/** 572/**
@@ -681,7 +679,8 @@ struct sway_container *tiling_container_at(
681 struct sway_container *con, double lx, double ly, 679 struct sway_container *con, double lx, double ly,
682 struct wlr_surface **surface, double *sx, double *sy) { 680 struct wlr_surface **surface, double *sx, double *sy) {
683 if (con->type == C_VIEW) { 681 if (con->type == C_VIEW) {
684 return container_at_view(con, lx, ly, surface, sx, sy); 682 surface_at_view(con, lx, ly, surface, sx, sy);
683 return con;
685 } 684 }
686 if (!con->children->length) { 685 if (!con->children->length) {
687 return NULL; 686 return NULL;
@@ -744,7 +743,7 @@ struct sway_container *container_at(struct sway_container *workspace,
744 struct sway_container *focus = 743 struct sway_container *focus =
745 seat_get_focus_inactive(seat, &root_container); 744 seat_get_focus_inactive(seat, &root_container);
746 if (focus && focus->type == C_VIEW) { 745 if (focus && focus->type == C_VIEW) {
747 container_at_view(focus, lx, ly, surface, sx, sy); 746 surface_at_view(focus, lx, ly, surface, sx, sy);
748 if (*surface && surface_is_popup(*surface)) { 747 if (*surface && surface_is_popup(*surface)) {
749 return focus; 748 return focus;
750 } 749 }