From 8ad9e19de05b238539dda65a1a642b94781994b3 Mon Sep 17 00:00:00 2001 From: IoIxD Date: Sun, 26 Apr 2026 12:44:04 -0700 Subject: [PATCH] fix viewport on wayland --- examples/basic/viewport.c | 9 +++------ src/backend/wayland.c | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/examples/basic/viewport.c b/examples/basic/viewport.c index 75524c4..930488d 100644 --- a/examples/basic/viewport.c +++ b/examples/basic/viewport.c @@ -31,13 +31,10 @@ int main() { if(px == NULL) px = MwLoadImage(vp, "picture.png"); - // MwVaCreateWidget(MwImageClass, "image", MwViewportGetViewport(vp), 0, 0, 1024, 1024, - // MwNpixmap, px, - // NULL); + MwVaCreateWidget(MwImageClass, "image", MwViewportGetViewport(vp), 0, 0, 1024, 1024, + MwNpixmap, px, + NULL); MwViewportSetSize(vp, 1024, 1024); - MwWidget f = MwCreateWidget(MwFrameClass, "fr", MwViewportGetViewport(vp), 256, 256, 128, 128); - f = MwCreateWidget(MwFrameClass, "fr", f, 0, 0, 128, 128); - MwCreateWidget(MwButtonClass, "btn", f, 64, 64, 128, 128); MwAddUserHandler(w, MwNresizeHandler, resize, NULL); diff --git a/src/backend/wayland.c b/src/backend/wayland.c index 90777ab..27fcadb 100644 --- a/src/backend/wayland.c +++ b/src/backend/wayland.c @@ -2516,7 +2516,6 @@ static void MwLLSetIconImpl(MwLL handle, MwLLPixmap pixmap) { static void MwLLForceRenderImpl(MwLL handle) { WIDGET_CHECK(handle); - if(handle->wayland.force_render) return; wl_surface_damage(handle->wayland.framebuffer.surface, 0, 0, handle->wayland.ww, handle->wayland.wh); handle->wayland.force_render = MwTRUE;