simplify client_get_clip
the clips for xwayland and xdg clients are pretty similar, after all we only need to adjust x and y for xdg clients
This commit is contained in:
parent
4f4c540bb9
commit
6d0ec595d3
25
client.h
25
client.h
|
@ -143,23 +143,22 @@ client_get_appid(Client *c)
|
||||||
static inline void
|
static inline void
|
||||||
client_get_clip(Client *c, struct wlr_box *clip)
|
client_get_clip(Client *c, struct wlr_box *clip)
|
||||||
{
|
{
|
||||||
|
struct wlr_box xdg_geom = {0};
|
||||||
|
*clip = (struct wlr_box){
|
||||||
|
.x = 0,
|
||||||
|
.y = 0,
|
||||||
|
.width = c->geom.width - c->bw,
|
||||||
|
.height = c->geom.height - c->bw,
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (client_is_x11(c)) {
|
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;
|
return;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
*clip = (struct wlr_box){
|
wlr_xdg_surface_get_geometry(c->surface.xdg, &xdg_geom);
|
||||||
.x = c->surface.xdg->pending.geometry.x,
|
clip->x = xdg_geom.x;
|
||||||
.y = c->surface.xdg->pending.geometry.y,
|
clip->y = xdg_geom.y;
|
||||||
.width = c->geom.width - c->bw,
|
|
||||||
.height = c->geom.height - c->bw};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
|
Loading…
Reference in a new issue