make always_render a global variable, MwWaylandAlwaysRender
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
a826ce5e12
commit
9757623d3c
3 changed files with 10 additions and 16 deletions
|
|
@ -127,7 +127,7 @@ typedef struct wayland_call_table {
|
||||||
} wayland_call_table_t;
|
} wayland_call_table_t;
|
||||||
|
|
||||||
extern wayland_call_table_t wl_call_tbl;
|
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 */
|
/* defined inline right here so that it doesn't conflict with the other macros */
|
||||||
MwInline int wayland_load_funcs() {
|
MwInline int wayland_load_funcs() {
|
||||||
wl_call_tbl.lib = MwDynamicOpen("libwayland-client.so");
|
wl_call_tbl.lib = MwDynamicOpen("libwayland-client.so");
|
||||||
|
|
@ -405,8 +405,6 @@ struct _MwLLWayland {
|
||||||
wayland_protocol_t* value;
|
wayland_protocol_t* value;
|
||||||
}* wl_protocol_map;
|
}* wl_protocol_map;
|
||||||
|
|
||||||
MwBool always_render;
|
|
||||||
|
|
||||||
MwBool has_decorations;
|
MwBool has_decorations;
|
||||||
char title[255];
|
char title[255];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wayland_call_table_t wl_call_tbl;
|
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. */
|
/* 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) \
|
#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);
|
MwLLDispatch(self, draw, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1999,17 +2000,17 @@ static int MwLLPendingImpl(MwLL handle) {
|
||||||
handle->wayland.did_initial_resize = 1;
|
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)) {
|
if(!poll(&fd, 1, timeout.tv_nsec)) {
|
||||||
wl_display_cancel_read(handle->wayland.display);
|
wl_display_cancel_read(handle->wayland.display);
|
||||||
} else {
|
} 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) {
|
if((pending = wl_display_dispatch_pending(handle->wayland.display)) < 0) {
|
||||||
wl_display_cancel_read(handle->wayland.display);
|
wl_display_cancel_read(handle->wayland.display);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(handle->wayland.always_render) {
|
if(MwWaylandAlwaysRender) {
|
||||||
handle->wayland.did_event_loop_early = MwTRUE;
|
handle->wayland.did_event_loop_early = MwTRUE;
|
||||||
event_loop(handle);
|
event_loop(handle);
|
||||||
return pending;
|
return pending;
|
||||||
|
|
@ -2024,7 +2025,7 @@ static int MwLLPendingImpl(MwLL handle) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLNextEventImpl(MwLL handle) {
|
static void MwLLNextEventImpl(MwLL handle) {
|
||||||
if(!handle->wayland.always_render) {
|
if(!MwWaylandAlwaysRender) {
|
||||||
if(handle->wayland.did_event_loop_early) {
|
if(handle->wayland.did_event_loop_early) {
|
||||||
handle->wayland.did_event_loop_early = MwFALSE;
|
handle->wayland.did_event_loop_early = MwFALSE;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -205,14 +205,9 @@ static int create(MwWidget handle) {
|
||||||
1,
|
1,
|
||||||
EGL_NONE};
|
EGL_NONE};
|
||||||
EGLDisplay display;
|
EGLDisplay display;
|
||||||
waylandopengl_t* o = r = malloc(sizeof(*o));
|
waylandopengl_t* o = r = malloc(sizeof(*o));
|
||||||
MwLL topmost_parent = handle->lowlevel->wayland.parent;
|
MwLL topmost_parent = handle->lowlevel->wayland.parent;
|
||||||
handle->lowlevel->wayland.always_render = MwTRUE;
|
MwWaylandAlwaysRender = MwTRUE;
|
||||||
|
|
||||||
while(topmost_parent->wayland.parent != NULL) {
|
|
||||||
topmost_parent->wayland.always_render = MwTRUE;
|
|
||||||
topmost_parent = topmost_parent->wayland.parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
o->gllib = MwDynamicOpen("libEGL.so");
|
o->gllib = MwDynamicOpen("libEGL.so");
|
||||||
if(!o->gllib) {
|
if(!o->gllib) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue