MAJOR REFACTOR (IN PROGRESS)

This commit is contained in:
do butterflies cry? 2025-08-27 16:36:00 +10:00
parent 632c5f18ee
commit 1e69ae1e21
32 changed files with 2952 additions and 2873 deletions

25
src/lib/decoration.c Normal file
View file

@ -0,0 +1,25 @@
void createdecoration(struct wl_listener *listener, void *data) {
struct wlr_xdg_toplevel_decoration_v1 *deco = data;
Client *c = deco->toplevel->base->data;
c->decoration = deco;
LISTEN(&deco->events.request_mode, &c->set_decoration_mode,
requestdecorationmode);
LISTEN(&deco->events.destroy, &c->destroy_decoration, destroydecoration);
requestdecorationmode(&c->set_decoration_mode, deco);
}
void destroydecoration(struct wl_listener *listener, void *data) {
Client *c = wl_container_of(listener, c, destroy_decoration);
wl_list_remove(&c->destroy_decoration.link);
wl_list_remove(&c->set_decoration_mode.link);
}
void requestdecorationmode(struct wl_listener *listener, void *data) {
Client *c = wl_container_of(listener, c, set_decoration_mode);
if (c->surface.xdg->initialized)
wlr_xdg_toplevel_decoration_v1_set_mode(
c->decoration, WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
}