mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2025-12-31 06:30:52 +00:00
fix bugs
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@500 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -116,8 +116,9 @@ MWDECL void MwLoop(MwWidget handle);
|
||||
/*!
|
||||
* @brief Runs the single step
|
||||
* @param handle Widget
|
||||
* @return `0` if successful
|
||||
*/
|
||||
MWDECL void MwStep(MwWidget handle);
|
||||
MWDECL int MwStep(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Check if any event is pending
|
||||
|
||||
12
src/core.c
12
src/core.c
@@ -263,9 +263,9 @@ static void clean_destroy_queue(MwWidget handle) {
|
||||
arrfree(handle->destroy_queue);
|
||||
}
|
||||
|
||||
void MwStep(MwWidget handle) {
|
||||
int MwStep(MwWidget handle) {
|
||||
int i;
|
||||
if(setjmp(handle->before_step)) return;
|
||||
if(setjmp(handle->before_step)) return 0;
|
||||
for(i = 0; i < arrlen(handle->children); i++) MwStep(handle->children[i]);
|
||||
|
||||
handle->prop_event = 0;
|
||||
@@ -273,6 +273,8 @@ void MwStep(MwWidget handle) {
|
||||
handle->prop_event = 1;
|
||||
|
||||
clean_destroy_queue(handle);
|
||||
if(handle->parent == NULL && handle->destroyed) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MwPending(MwWidget handle) {
|
||||
@@ -287,7 +289,11 @@ void MwLoop(MwWidget handle) {
|
||||
long tick = MwLLGetTick();
|
||||
int i;
|
||||
while(!handle->close) {
|
||||
while(MwPending(handle)) MwStep(handle);
|
||||
int v = 0;
|
||||
while(MwPending(handle)) {
|
||||
if((v = MwStep(handle)) != 0) break;
|
||||
}
|
||||
if(v != 0) break;
|
||||
|
||||
for(i = 0; i < arrlen(handle->tick_list); i++) {
|
||||
MwDispatchUserHandler(handle->tick_list[i], MwNtickHandler, NULL);
|
||||
|
||||
Reference in New Issue
Block a user