From edb01d001403d918ac7e91d69cd56e2fa7c913df Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Thu, 26 Feb 2026 13:33:20 -0800 Subject: [PATCH] [digesting_libdecor] port over the frame commit workaround --- build.sh | 2 +- digesting_libdecor.c | 19 ++++++++++++++++--- digesting_libdecor.h | 3 +++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 667c381..5391f3b 100755 --- a/build.sh +++ b/build.sh @@ -1,2 +1,2 @@ #!/bin/bash -./wayland_libdecor_egl__frame_commit_workaround.c \ No newline at end of file +./digesting_libdecor.c \ No newline at end of file diff --git a/digesting_libdecor.c b/digesting_libdecor.c index e14dc17..16df9e4 100755 --- a/digesting_libdecor.c +++ b/digesting_libdecor.c @@ -179,13 +179,19 @@ libdecorevent__frame_configure(struct libdecor_frame *frame, int w = ctx.w; int h = ctx.h; if (libdecor_configuration_get_content_size(config, frame, &w, &h)){ + ctx.w = w; + ctx.h = h; + } + if (!ctx.configured){ + ctx.configured = 1; struct libdecor_state *state = libdecor_state_new(w, h); libdecor_frame_commit(frame, state, config); libdecor_state_free(state); } - ctx.configured = 1; - ctx.w = w; - ctx.h = h; + else{ + ctx.has_cached_config = 1; + ctx.cached_config = *config; + } } static void @@ -584,6 +590,13 @@ int main(){ exit_loop = 1; } + if (ctx.has_cached_config){ + ctx.has_cached_config = 0; + struct libdecor_state *state = libdecor_state_new(ctx.w, ctx.h); + libdecor_frame_commit(ctx.libdecor_frame, state, &ctx.cached_config); + libdecor_state_free(state); + } + /* (nodocs-wl_egl) */ wl_egl_window_resize(ctx.wl_egl_window, ctx.w, ctx.h, 0, 0); diff --git a/digesting_libdecor.h b/digesting_libdecor.h index 22306a5..74ccf9d 100644 --- a/digesting_libdecor.h +++ b/digesting_libdecor.h @@ -640,6 +640,9 @@ typedef struct Ctx{ EGLDisplay egl_display; EGLContext egl_context; EGLSurface egl_surface; + + int has_cached_config; + struct libdecor_configuration cached_config; } Ctx; #endif //DIGESTING_LIBDECOR_H