feat: tearing support

This commit is contained in:
DreamMaoMao
2025-11-04 23:02:29 +08:00
parent 3645817f2d
commit 9c7436ba71
7 changed files with 234 additions and 11 deletions

View File

@@ -153,6 +153,20 @@ static inline void client_get_geometry(Client *c, struct wlr_box *geom) {
*geom = c->surface.xdg->geometry;
}
static inline Client *get_client_from_surface(struct wlr_surface *surface) {
if (!surface)
return NULL;
// 从 surface 的 data 指针获取 scene tree
struct wlr_scene_tree *scene_tree = surface->data;
if (!scene_tree)
return NULL;
// 从 scene tree 的 node data 获取 Client
Client *c = scene_tree->node.data;
return c;
}
static inline Client *client_get_parent(Client *c) {
Client *p = NULL;
#ifdef XWAYLAND