From e1f3983bf8a548f0357a92d9023c90aa4c273f64 Mon Sep 17 00:00:00 2001 From: Leonardo Hernández Hernández Date: Sat, 8 Jul 2023 20:08:45 -0600 Subject: use wlr_scene_subsurface_tree_set_clip References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4131 Closes: https://github.com/djpohly/dwl/issues/411 --- client.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'client.h') diff --git a/client.h b/client.h index 6a870b4..012ba74 100644 --- a/client.h +++ b/client.h @@ -140,6 +140,28 @@ client_get_appid(Client *c) return c->surface.xdg->toplevel->app_id; } +static inline void +client_get_clip(Client *c, struct wlr_box *clip) +{ +#ifdef XWAYLAND + if (client_is_x11(c)) { + *clip = (struct wlr_box){ + .x = 0, + .y = 0, + .width = c->geom.width - c->bw, + .height = c->geom.height - c->bw}; + return; + } +#endif + + *clip = (struct wlr_box){ + .x = c->surface.xdg->pending.geometry.x, + .y = c->surface.xdg->pending.geometry.y, + .width = c->geom.width - c->bw, + .height = c->geom.height - c->bw}; + +} + static inline void client_get_geometry(Client *c, struct wlr_box *geom) { -- cgit v1.2.3