one screens layer working

This commit is contained in:
Rakarake 2026-01-27 16:46:30 +01:00
parent 400137930a
commit b0420b41eb
2 changed files with 11 additions and 7 deletions

View file

@ -80,7 +80,7 @@ static void zwlr_layer_surface_v1_configure(void *data, struct zwlr_layer_surfac
next->data.height = height;
wl_egl_window_resize(next->data.egl_window, width, height, 0, 0);
zwlr_layer_surface_v1_ack_configure(zwlr_layer_surface_v1, serial);
printf("🐍🐍🐍🐍\n");
printf("🐍🐍🐍🐍, setting layer to dirty: %p\n", &next->data);
// draw new frame!
next->data.dirty = true;
}
@ -107,11 +107,6 @@ wl_surface_frame_done(void *data, struct wl_callback *cb, uint32_t time) {
struct surface *surface = data;
surface->dirty = true;
//struct client_state *state = surface->state;
/* Request another frame */
// TODO make sure this is done after the frame has been handled, maybe
cb = wl_surface_frame(surface->wl_surface);
wl_callback_add_listener(cb, &wl_surface_frame_listener, surface);
}
static const struct wl_callback_listener wl_surface_frame_listener = {
@ -219,6 +214,7 @@ static void registry_handle_global(
// frame callback
struct wl_callback *cb = wl_surface_frame(wl_surface);
wl_callback_add_listener(cb, &wl_surface_frame_listener, surface_location);
printf("zwlr layer callback configured 🐯🐯🐯🐯🐯🐯🐯\n");
}
}
@ -405,6 +401,13 @@ void swap_buffers(struct client_state *state, struct surface *surface) {
while (next != NULL) {
if (&next->data == surface) {
eglSwapBuffers(state->egl_display, next->data.egl_surface);
// maybe unecessary
wl_display_dispatch(state->wl_display);
/* Request another frame */
// TODO make sure this is done after the frame has been handled, maybe
struct wl_callback *cb = wl_surface_frame(surface->wl_surface);
wl_callback_add_listener(cb, &wl_surface_frame_listener, surface);
return;
}
}