make always_render a global variable, MwWaylandAlwaysRender
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
IoI_xD 2026-03-24 23:24:20 -07:00
commit 9757623d3c
3 changed files with 10 additions and 16 deletions

View file

@ -127,7 +127,7 @@ typedef struct wayland_call_table {
} wayland_call_table_t;
extern wayland_call_table_t wl_call_tbl;
extern MwBool MwWaylandAlwaysRender;
/* defined inline right here so that it doesn't conflict with the other macros */
MwInline int wayland_load_funcs() {
wl_call_tbl.lib = MwDynamicOpen("libwayland-client.so");
@ -405,8 +405,6 @@ struct _MwLLWayland {
wayland_protocol_t* value;
}* wl_protocol_map;
MwBool always_render;
MwBool has_decorations;
char title[255];

View file

@ -20,6 +20,7 @@
#endif
wayland_call_table_t wl_call_tbl;
MwBool MwWaylandAlwaysRender = MwFALSE;
/* Standard procedure before most event callbacks in Wayland ("most" because the setup ones don't need this). Wait for the Mutex to be freed, if we're deadlocking for longer then a quarter of a second then do nothing with the event. */
#define WAYLAND_EVENT_OP_START(self) \
@ -770,7 +771,7 @@ static void keyboard_key(void* data,
}
}
if(!self->wayland.always_render) {
if(!MwWaylandAlwaysRender) {
MwLLDispatch(self, draw, NULL);
}
@ -1999,17 +2000,17 @@ static int MwLLPendingImpl(MwLL handle) {
handle->wayland.did_initial_resize = 1;
}
if(!handle->wayland.always_render) wl_display_prepare_read(handle->wayland.display);
if(!MwWaylandAlwaysRender) wl_display_prepare_read(handle->wayland.display);
if(!poll(&fd, 1, timeout.tv_nsec)) {
wl_display_cancel_read(handle->wayland.display);
} else {
if(!handle->wayland.always_render) wl_display_read_events(handle->wayland.display);
if(!MwWaylandAlwaysRender) wl_display_read_events(handle->wayland.display);
if((pending = wl_display_dispatch_pending(handle->wayland.display)) < 0) {
wl_display_cancel_read(handle->wayland.display);
}
}
if(handle->wayland.always_render) {
if(MwWaylandAlwaysRender) {
handle->wayland.did_event_loop_early = MwTRUE;
event_loop(handle);
return pending;
@ -2024,7 +2025,7 @@ static int MwLLPendingImpl(MwLL handle) {
}
static void MwLLNextEventImpl(MwLL handle) {
if(!handle->wayland.always_render) {
if(!MwWaylandAlwaysRender) {
if(handle->wayland.did_event_loop_early) {
handle->wayland.did_event_loop_early = MwFALSE;
} else {

View file

@ -205,14 +205,9 @@ static int create(MwWidget handle) {
1,
EGL_NONE};
EGLDisplay display;
waylandopengl_t* o = r = malloc(sizeof(*o));
MwLL topmost_parent = handle->lowlevel->wayland.parent;
handle->lowlevel->wayland.always_render = MwTRUE;
while(topmost_parent->wayland.parent != NULL) {
topmost_parent->wayland.always_render = MwTRUE;
topmost_parent = topmost_parent->wayland.parent;
}
waylandopengl_t* o = r = malloc(sizeof(*o));
MwLL topmost_parent = handle->lowlevel->wayland.parent;
MwWaylandAlwaysRender = MwTRUE;
o->gllib = MwDynamicOpen("libEGL.so");
if(!o->gllib) {