This commit is contained in:
Nishi 2026-04-07 22:59:16 +09:00
commit 8a5a2f0f02
Signed by: nishi
GPG key ID: 27EF69B208EB9343
2 changed files with 18 additions and 23 deletions

View file

@ -138,12 +138,6 @@ MWDECL void MwLoop(MwWidget handle);
*/
MWDECL int MwStep(MwWidget handle);
/*!
* @brief Runs the stuff needed after one event loop
* @param handle Widget
*/
MWDECL void MwAfterStep(MwWidget handle);
/*!
* @brief Check if any event is pending
* @param handle Widget

View file

@ -410,6 +410,22 @@ static void clean_destroy_queue(MwWidget handle) {
arrfree(handle->destroy_queue);
}
static void MwAfterStep(MwWidget handle) {
#ifdef PERIODIC
if(handle->top_step) {
int i;
for(i = 0; i < arrlen(handle->draw_queue); i++) {
DRAW(handle->draw_queue[i]);
}
arrfree(handle->draw_queue);
}
#else
(void)handle;
#endif
}
int MwStep(MwWidget handle) {
int i;
MwWidget* widgets = NULL;
@ -428,6 +444,8 @@ int MwStep(MwWidget handle) {
handle->prop_event = 1;
if(handle->top_step) MwAfterStep(handle);
clean_destroy_queue(handle);
if(handle->parent == NULL && handle->destroyed) {
MwFreeWidget(handle);
@ -436,22 +454,6 @@ int MwStep(MwWidget handle) {
return 0;
}
void MwAfterStep(MwWidget handle) {
#ifdef PERIODIC
if(handle->top_step) {
int i;
for(i = 0; i < arrlen(handle->draw_queue); i++) {
DRAW(handle->draw_queue[i]);
}
arrfree(handle->draw_queue);
}
#else
(void)handle;
#endif
}
int MwPending(MwWidget handle) {
int i;
for(i = 0; i < arrlen(handle->children); i++) {
@ -474,7 +476,6 @@ void MwLoop(MwWidget handle) {
if((v = MwStep(handle)) != 0) break;
}
if(v != 0) break;
MwAfterStep(handle);
for(i = 0; i < arrlen(handle->tick_list); i++) {
MwDispatch(handle->tick_list[i], tick);