WIP wlr_layer_shell

This commit is contained in:
Rakarake 2025-12-25 23:59:11 +01:00
parent 72a53cb6c8
commit 29a8910556
3 changed files with 19 additions and 2 deletions

View file

@ -54,6 +54,17 @@ static const struct xdg_toplevel_listener xdg_toplevel_listener = {
.close = xdg_toplevel_close,
};
static void zwlr_layer_surface_v1_configure(void *data, struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, uint32_t serial, uint32_t width, uint32_t height) {
struct client_state *state = data;
state->width = width;
state->height = height;
wl_egl_window_resize(state->egl_window, width, height, 0, 0);
}
static const struct zwlr_layer_surface_v1_listener zwlr_layer_surface_v1_listener = {
.configure = zwlr_layer_surface_v1_configure,
};
static void registry_handle_global(
void *data,
struct wl_registry *registry,
@ -87,6 +98,8 @@ static void registry_handle_global(
}
if ((strcmp(interface, zwlr_layer_shell_v1_interface.name) == 0) && (state->output_type == OUTPUT_LAYER)) {
state->zwlr_layer_shell_v1 = wl_registry_bind(registry, name, &zwlr_layer_shell_v1_interface, 4);
int layer = ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND;
state->zwlr_layer_surface_v1 = zwlr_layer_shell_v1_get_layer_surface(state->zwlr_layer_shell_v1, state->wl_surface, NULL, layer, "wallpaper");
}
if (strcmp(interface, wl_output_interface.name) == 0) {
state->wl_output = wl_registry_bind(