[digesting_libdecor] port over the frame commit workaround

main
Allen Webster 2026-02-26 13:33:20 -08:00
parent b6797e9931
commit edb01d0014
3 changed files with 20 additions and 4 deletions

View File

@ -1,2 +1,2 @@
#!/bin/bash
./wayland_libdecor_egl__frame_commit_workaround.c
./digesting_libdecor.c

View File

@ -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);

View File

@ -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