aboutsummaryrefslogtreecommitdiff
path: root/rootston/desktop.c
diff options
context:
space:
mode:
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r--rootston/desktop.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c
index d7da1600..1ec1d552 100644
--- a/rootston/desktop.c
+++ b/rootston/desktop.c
@@ -31,6 +31,18 @@ void view_get_box(const struct roots_view *view, struct wlr_box *box) {
}
}
+void view_get_deco_box(const struct roots_view *view, struct wlr_box *box) {
+ view_get_box(view, box);
+ if (!view->decorated) {
+ return;
+ }
+
+ box->x -= view->border_width;
+ box->y -= (view->border_width + view->titlebar_height);
+ box->width += view->border_width * 2;
+ box->height += (view->border_width * 2 + view->titlebar_height);
+}
+
static void view_update_output(const struct roots_view *view,
const struct wlr_box *before) {
struct roots_desktop *desktop = view->desktop;
@@ -380,6 +392,14 @@ struct roots_view *desktop_view_at(struct roots_desktop *desktop, double lx,
if (view_at(view, lx, ly, surface, sx, sy)) {
return view;
}
+
+ if (view->decorated) {
+ struct wlr_box deco_box;
+ view_get_deco_box(view, &deco_box);
+ if (wlr_box_contains_point(&deco_box, lx, ly)) {
+ return view;
+ }
+ }
}
return NULL;
}