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
This commit is contained in:
parent
31bf1cbaf6
commit
e1f3983bf8
22
client.h
22
client.h
|
@ -140,6 +140,28 @@ client_get_appid(Client *c)
|
||||||
return c->surface.xdg->toplevel->app_id;
|
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
|
static inline void
|
||||||
client_get_geometry(Client *c, struct wlr_box *geom)
|
client_get_geometry(Client *c, struct wlr_box *geom)
|
||||||
{
|
{
|
||||||
|
|
3
dwl.c
3
dwl.c
|
@ -1909,6 +1909,7 @@ void
|
||||||
resize(Client *c, struct wlr_box geo, int interact)
|
resize(Client *c, struct wlr_box geo, int interact)
|
||||||
{
|
{
|
||||||
struct wlr_box *bbox = interact ? &sgeom : &c->mon->w;
|
struct wlr_box *bbox = interact ? &sgeom : &c->mon->w;
|
||||||
|
struct wlr_box clip;
|
||||||
client_set_bounds(c, geo.width, geo.height);
|
client_set_bounds(c, geo.width, geo.height);
|
||||||
c->geom = geo;
|
c->geom = geo;
|
||||||
applybounds(c, bbox);
|
applybounds(c, bbox);
|
||||||
|
@ -1927,6 +1928,8 @@ resize(Client *c, struct wlr_box geo, int interact)
|
||||||
/* this is a no-op if size hasn't changed */
|
/* this is a no-op if size hasn't changed */
|
||||||
c->resize = client_set_size(c, c->geom.width - 2 * c->bw,
|
c->resize = client_set_size(c, c->geom.width - 2 * c->bw,
|
||||||
c->geom.height - 2 * c->bw);
|
c->geom.height - 2 * c->bw);
|
||||||
|
client_get_clip(c, &clip);
|
||||||
|
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue