Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Commit

Permalink
use wlr_scene_subsurface_tree_set_clip
Browse files Browse the repository at this point in the history
  • Loading branch information
sevz17 committed Nov 11, 2023
1 parent ba8c398 commit 031f4e3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
22 changes: 22 additions & 0 deletions client.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,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)
{
Expand Down
3 changes: 3 additions & 0 deletions dwl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1920,6 +1920,7 @@ void
resize(Client *c, struct wlr_box geo, int interact)
{
struct wlr_box *bbox = interact ? &sgeom : &c->mon->w;
struct wlr_box clip;
client_set_bounds(c, geo.width, geo.height);
c->geom = geo;
applybounds(c, bbox);
Expand All @@ -1938,6 +1939,8 @@ resize(Client *c, struct wlr_box geo, int interact)
/* this is a no-op if size hasn't changed */
c->resize = client_set_size(c, c->geom.width - 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
Expand Down

0 comments on commit 031f4e3

Please sign in to comment.