[digesting_libdecor] port over the frame commit workaround
parent
b6797e9931
commit
edb01d0014
2
build.sh
2
build.sh
|
|
@ -1,2 +1,2 @@
|
|||
#!/bin/bash
|
||||
./wayland_libdecor_egl__frame_commit_workaround.c
|
||||
./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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue