From 8a5a2f0f0249f7dd91c5619183861f6d088d78f8 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Tue, 7 Apr 2026 22:59:16 +0900 Subject: [PATCH] nvm --- include/Mw/Core.h | 6 ------ src/core.c | 35 ++++++++++++++++++----------------- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/include/Mw/Core.h b/include/Mw/Core.h index 7eb5fdd..4d3e4b9 100644 --- a/include/Mw/Core.h +++ b/include/Mw/Core.h @@ -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 diff --git a/src/core.c b/src/core.c index 369b570..0d94c63 100644 --- a/src/core.c +++ b/src/core.c @@ -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);