unanimated backgrounds on both monitors

This commit is contained in:
Rakarake 2026-01-27 17:18:30 +01:00
parent b0420b41eb
commit b20f48ebc0
2 changed files with 6 additions and 4 deletions

View file

@ -66,6 +66,7 @@ int main(int argc, char *argv[]) {
int width = event.data.draw.width;
int height = event.data.draw.height;
render(&renderer, width, height, time, shader_path, 0);
printf("about to 🦬 swap buf %p\n", event.data.draw.surface);
swap_buffers(&state, event.data.draw.surface);
printf("🦬🦬🦬 swaping a buffalo\n");
}

View file

@ -400,16 +400,17 @@ void swap_buffers(struct client_state *state, struct surface *surface) {
struct surface_list *next = state->surface_list;
while (next != NULL) {
if (&next->data == surface) {
printf("swapping this buffer 🐃: %p\n", &next->data);
eglSwapBuffers(state->egl_display, next->data.egl_surface);
// maybe unecessary
// maybe unecessary TODO maybe really bad?
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);
//struct wl_callback *cb = wl_surface_frame(surface->wl_surface);
//wl_callback_add_listener(cb, &wl_surface_frame_listener, surface);
return;
}
next = next->next;
}
fprintf(stderr, "didn't find surface for buffer swap\n");
}