From 2ceed512a82dbfdcf34305969c6d429cf0961816 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 1 May 2018 18:23:40 +1000 Subject: Fix surface offset when using borders --- sway/tree/container.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sway/tree/container.c') diff --git a/sway/tree/container.c b/sway/tree/container.c index 03d7e49c..cb0233db 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; -- cgit v1.2.3 From 19d6cc395dfcb73fa7fc70a0691a38005afc334f Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 1 May 2018 19:50:54 +1000 Subject: Allow clicking view decorations to focus view --- sway/tree/container.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sway/tree/container.c') diff --git a/sway/tree/container.c b/sway/tree/container.c index cb0233db..995da5ce 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -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); } -- cgit v1.2.3