aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-05-01 15:31:02 +0100
committerGitHub <noreply@github.com>2018-05-01 15:31:02 +0100
commit0e51c7be449dd68025d5acd8c634f8dcacb10a16 (patch)
treec2c7e713a150c7f9a947b100e0fa4c56efb5c3b2 /sway/tree/container.c
parentbf0603cd2d905554cc57d121b56b6708bb1d382b (diff)
parentcb07434913b89580a4025824cb181733b2db1eb7 (diff)
Merge pull request #1874 from RyanDwyer/borders
Implement borders
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 03d7e49c..995da5ce 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -423,8 +423,8 @@ struct sway_container *container_at(struct sway_container *parent,
soutput->sway_output->wlr_output);
double ox = lx - output_box->x;
double oy = ly - output_box->y;
- double view_sx = ox - swayc->x;
- double view_sy = oy - swayc->y;
+ double view_sx = ox - sview->x;
+ double view_sy = oy - sview->y;
double _sx, _sy;
struct wlr_surface *_surface;
@@ -455,6 +455,16 @@ struct sway_container *container_at(struct sway_container *parent,
*surface = _surface;
return swayc;
}
+ // Check the view's decorations
+ struct wlr_box swayc_box = {
+ .x = swayc->x,
+ .y = swayc->y,
+ .width = swayc->width,
+ .height = swayc->height,
+ };
+ if (wlr_box_contains_point(&swayc_box, ox, oy)) {
+ return swayc;
+ }
} else {
list_cat(queue, swayc->children);
}