swap buffers on all children

This commit is contained in:
IoIxD 2025-12-07 19:33:16 -07:00
commit 1e5ff44d79
3 changed files with 14 additions and 13 deletions

1
.clangd Normal file
View file

@ -0,0 +1 @@
header-insertion: never

View file

@ -821,10 +821,11 @@ static void MwLLLineImpl(MwLL handle, MwPoint* points, MwLLColor color) {
} }
static void MwLLBeginDrawImpl(MwLL handle) { static void MwLLBeginDrawImpl(MwLL handle) {
if(!eglMakeCurrent(handle->wayland.egl_display, handle->wayland.egl_surface, handle->wayland.egl_surface, handle->wayland.egl_context)) { if(handle->wayland.parent == NULL)
printf("ERROR: eglMakeCurrent, %0X\n", eglGetError()); if(!eglMakeCurrent(handle->wayland.egl_display, handle->wayland.egl_surface, handle->wayland.egl_surface, handle->wayland.egl_context)) {
return; printf("ERROR: eglMakeCurrent, %0X\n", eglGetError());
} return;
}
} }
static void MwLLEndDrawImpl(MwLL handle) { static void MwLLEndDrawImpl(MwLL handle) {
@ -861,11 +862,12 @@ static void MwLLEndDrawImpl(MwLL handle) {
wl_surface_damage(handle->wayland.surface, 0, 0, handle->wayland.ww, handle->wayland.wh); wl_surface_damage(handle->wayland.surface, 0, 0, handle->wayland.ww, handle->wayland.wh);
if(!eglSwapBuffers(handle->wayland.egl_display, handle->wayland.egl_surface)) { if(handle->wayland.parent == NULL)
printf("error swapping buffers! %0X\n", eglGetError()); if(!eglSwapBuffers(handle->wayland.egl_display, handle->wayland.egl_surface)) {
} else { printf("error swapping buffers! %0X\n", eglGetError());
wl_surface_commit(handle->wayland.surface); } else {
} wl_surface_commit(handle->wayland.surface);
}
} }
static MwLLColor MwLLAllocColorImpl(MwLL handle, int r, int g, int b) { static MwLLColor MwLLAllocColorImpl(MwLL handle, int r, int g, int b) {

View file

@ -7,16 +7,14 @@ static void lldrawhandler(MwLL handle, void* data) {
MwWidget h = (MwWidget)handle->common.user; MwWidget h = (MwWidget)handle->common.user;
(void)data; (void)data;
if(handle->wayland.parent == NULL) MwLLBeginDraw(handle);
MwLLBeginDraw(handle);
h->bgcolor = NULL; h->bgcolor = NULL;
MwDispatch(h, draw); MwDispatch(h, draw);
if(h->draw_inject != NULL) h->draw_inject(h); if(h->draw_inject != NULL) h->draw_inject(h);
MwDispatchUserHandler(h, MwNdrawHandler, NULL); MwDispatchUserHandler(h, MwNdrawHandler, NULL);
if(handle->wayland.parent == NULL) MwLLEndDraw(handle);
MwLLEndDraw(handle);
} }
static void lluphandler(MwLL handle, void* data) { static void lluphandler(MwLL handle, void* data) {