diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-27 08:45:19 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-27 08:45:19 +0300 |
commit | f08bfcc676b61c814e31c6bf5fecf130a9c45415 (patch) | |
tree | 30a54e90586e366960dbc818d52673070271f9df | |
parent | 247b2c6cdea3e57f4d22d375b43927bc9f39efc8 (diff) |
Periodic: Fixed dispatch without active UI root
-rw-r--r-- | src/periodic.c | 8 |
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); |