forked from pyrite-dev/milsko
h
This commit is contained in:
parent
21d07056d9
commit
261622a2e0
2 changed files with 5 additions and 19 deletions
|
|
@ -507,8 +507,7 @@ struct _MwLLWayland {
|
||||||
|
|
||||||
MwU32 mw, mh; /* Monitor width and height as advertised by wl_output.mode */
|
MwU32 mw, mh; /* Monitor width and height as advertised by wl_output.mode */
|
||||||
|
|
||||||
MwLL parent;
|
MwLL parent;
|
||||||
MwLL* children;
|
|
||||||
|
|
||||||
MwBool force_render;
|
MwBool force_render;
|
||||||
MwBool did_event_loop_early;
|
MwBool did_event_loop_early;
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ static void undestroy(MwLL self) {
|
||||||
/* Standard procedure before event callbacks in Wayland */
|
/* Standard procedure before event callbacks in Wayland */
|
||||||
#define WAYLAND_EVENT_OP_START(self) \
|
#define WAYLAND_EVENT_OP_START(self) \
|
||||||
if(is_destroyed(self)) { \
|
if(is_destroyed(self)) { \
|
||||||
|
printf("[WARNING] Operation on invalid widget at line %d\n", __LINE__); \
|
||||||
return; \
|
return; \
|
||||||
} \
|
} \
|
||||||
pthread_mutex_lock(&self->wayland.eventsMutex);
|
pthread_mutex_lock(&self->wayland.eventsMutex);
|
||||||
|
|
@ -1934,10 +1935,6 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(parent != NULL) {
|
|
||||||
arrput(parent->wayland.children, r);
|
|
||||||
}
|
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2014,17 +2011,6 @@ static void MwLLDestroyImpl(MwLL handle) {
|
||||||
|
|
||||||
wl_flush(handle);
|
wl_flush(handle);
|
||||||
|
|
||||||
if(handle->wayland.parent != NULL) {
|
|
||||||
for(i = 0; i < arrlen(handle->wayland.parent->wayland.children); i++) {
|
|
||||||
if(handle->wayland.parent->wayland.children[i] == handle) {
|
|
||||||
arrdel(handle->wayland.parent->wayland.children, i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
arrfree(handle->wayland.children);
|
|
||||||
|
|
||||||
free(handle);
|
free(handle);
|
||||||
|
|
||||||
pthread_mutex_lock(&destroyedWidgetsTableMutex);
|
pthread_mutex_lock(&destroyedWidgetsTableMutex);
|
||||||
|
|
@ -2054,7 +2040,7 @@ static void recursive_render(MwLL handle) {
|
||||||
int i;
|
int i;
|
||||||
WIDGET_CHECK(handle);
|
WIDGET_CHECK(handle);
|
||||||
|
|
||||||
for(i = 0; i < arrlen(handle->wayland.children); i++) recursive_render(handle->wayland.children[i]);
|
for(i = 0; i < arrlen(((MwWidget)handle->common.user)->children); i++) recursive_render(((MwWidget)handle->common.user)->children[i]->lowlevel);
|
||||||
|
|
||||||
MwLLForceRender(handle);
|
MwLLForceRender(handle);
|
||||||
}
|
}
|
||||||
|
|
@ -2301,7 +2287,8 @@ static int MwLLPendingImpl(MwLL handle) {
|
||||||
.events = POLLOUT,
|
.events = POLLOUT,
|
||||||
};
|
};
|
||||||
int pending = 0;
|
int pending = 0;
|
||||||
if(!handle->wayland.valid) {
|
|
||||||
|
if(is_destroyed(handle) || !handle->wayland.valid) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue