From 59d9e3dc6eed51fb7a453db3b4d5fee7a1d58665 Mon Sep 17 00:00:00 2001 From: IoIxD Date: Sat, 26 Sep 2026 18:16:15 -0700 Subject: [PATCH] impl showimpl when we don't use subsurfaces anymore --- include/Mw/LowLevel/Wayland.h | 2 ++ src/backend/wayland/wayland.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/include/Mw/LowLevel/Wayland.h b/include/Mw/LowLevel/Wayland.h index 01f772c3..c49af026 100644 --- a/include/Mw/LowLevel/Wayland.h +++ b/include/Mw/LowLevel/Wayland.h @@ -462,6 +462,8 @@ struct _MwLLWayland { long end_time; MwBool accepts_dnd; + + MwBool shown; }; struct _MwLLWaylandColor { diff --git a/src/backend/wayland/wayland.c b/src/backend/wayland/wayland.c index 4ab9a73f..8ffd0e18 100644 --- a/src/backend/wayland/wayland.c +++ b/src/backend/wayland/wayland.c @@ -1001,6 +1001,10 @@ static void draw_child(MwLL handle, MwLL child) { wl_surface_commit(child->wayland.framebuffer.surface); + if(!child->wayland.shown) { + return; + } + cs = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, child->wayland.ww, child->wayland.wh); c = cairo_create(cs); @@ -1056,6 +1060,9 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) { r->wayland.is_toplevel = parent == NULL; r->wayland.is_clipping = 0; + /* notably not in widget setup, if a user detaches a widget or whatever it should keep this state */ + r->wayland.shown = MwTRUE; + widget_setup(r, parent, x, y, width, height, MwLL_WAYLAND_UNKNOWN); #ifdef USE_DBUS @@ -1723,6 +1730,8 @@ static void MwLLDetachImpl(MwLL handle, MwPoint* point) { } static void MwLLShowImpl(MwLL handle, int show) { + handle->wayland.shown = show; + if(!handle->wayland.configured) { return; }