summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-05-27 08:45:19 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-05-27 08:45:19 +0300
commitf08bfcc676b61c814e31c6bf5fecf130a9c45415 (patch)
tree30a54e90586e366960dbc818d52673070271f9df
parent247b2c6cdea3e57f4d22d375b43927bc9f39efc8 (diff)
Periodic: Fixed dispatch without active UI root
-rw-r--r--src/periodic.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/periodic.c b/src/periodic.c
index 068f2a1e..ef3d8033 100644
--- a/src/periodic.c
+++ b/src/periodic.c
@@ -91,9 +91,11 @@ iBool dispatchCommands_Periodic(iPeriodic *d) {
91 .data1 = (void *) cstr_String(&pc->command), 91 .data1 = (void *) cstr_String(&pc->command),
92 .data2 = findRoot_Window(get_Window(), pc->context) 92 .data2 = findRoot_Window(get_Window(), pc->context)
93 }; 93 };
94 setCurrent_Root(ev.data2); 94 if (ev.data2) {
95 dispatchEvent_Widget(pc->context, (const SDL_Event *) &ev); 95 setCurrent_Root(ev.data2);
96 wasPosted = iTrue; 96 dispatchEvent_Widget(pc->context, (const SDL_Event *) &ev);
97 wasPosted = iTrue;
98 }
97 } 99 }
98 removePending_Periodic_(d); 100 removePending_Periodic_(d);
99 setCurrent_Root(NULL); 101 setCurrent_Root(NULL);