diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-01 22:49:53 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-01 22:49:53 +0300 |
commit | a05d181c72df33256e603f2e4543ee73665b242c (patch) | |
tree | 9c88eda1a5054e0098d846c20bb52a70dcfe3569 | |
parent | 1e1519b34de372e4ca537cb5fa78df08401ee6b4 (diff) |
Fixed premature recycling
Processing events outside event loop lead to recycler being called when a refresh was requested.
-rw-r--r-- | src/app.c | 2 | ||||
-rw-r--r-- | src/ui/util.c | 8 |
2 files changed, 5 insertions, 5 deletions
@@ -241,6 +241,7 @@ static int run_App_(iApp *d) { | |||
241 | runTickers_App_(d); | 241 | runTickers_App_(d); |
242 | processEvents_App(waitForNewEvents_AppEventMode); | 242 | processEvents_App(waitForNewEvents_AppEventMode); |
243 | refresh_App(); | 243 | refresh_App(); |
244 | recycle_Garbage(); | ||
244 | } | 245 | } |
245 | return 0; | 246 | return 0; |
246 | } | 247 | } |
@@ -249,7 +250,6 @@ void refresh_App(void) { | |||
249 | iApp *d = &app_; | 250 | iApp *d = &app_; |
250 | destroyPending_Widget(); | 251 | destroyPending_Widget(); |
251 | draw_Window(d->window); | 252 | draw_Window(d->window); |
252 | recycle_Garbage(); | ||
253 | d->pendingRefresh = iFalse; | 253 | d->pendingRefresh = iFalse; |
254 | } | 254 | } |
255 | 255 | ||
diff --git a/src/ui/util.c b/src/ui/util.c index 785841c9..8a174393 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -195,7 +195,7 @@ iWidget *makeMenu_Widget(iWidget *parent, const iMenuItem *items, size_t n) { | |||
195 | 195 | ||
196 | void openMenu_Widget(iWidget *d, iInt2 coord) { | 196 | void openMenu_Widget(iWidget *d, iInt2 coord) { |
197 | /* Menu closes when commands are emitted, so handle any pending ones beforehand. */ | 197 | /* Menu closes when commands are emitted, so handle any pending ones beforehand. */ |
198 | processEvents_App(postedEventsOnly_AppEventMode); | 198 | // processEvents_App(postedEventsOnly_AppEventMode); |
199 | setFlags_Widget(d, hidden_WidgetFlag, iFalse); | 199 | setFlags_Widget(d, hidden_WidgetFlag, iFalse); |
200 | arrange_Widget(d); | 200 | arrange_Widget(d); |
201 | d->rect.pos = coord; | 201 | d->rect.pos = coord; |
@@ -447,7 +447,7 @@ void makeFilePath_Widget(iWidget * parent, | |||
447 | const char * acceptLabel, | 447 | const char * acceptLabel, |
448 | const char * command) { | 448 | const char * command) { |
449 | setFocus_Widget(NULL); | 449 | setFocus_Widget(NULL); |
450 | processEvents_App(postedEventsOnly_AppEventMode); | 450 | // processEvents_App(postedEventsOnly_AppEventMode); |
451 | iWidget *dlg = makeSheet_Widget(command); | 451 | iWidget *dlg = makeSheet_Widget(command); |
452 | setCommandHandler_Widget(dlg, filePathHandler_); | 452 | setCommandHandler_Widget(dlg, filePathHandler_); |
453 | addChild_Widget(parent, iClob(dlg)); | 453 | addChild_Widget(parent, iClob(dlg)); |
@@ -525,7 +525,7 @@ iWidget *makeValueInput_Widget(iWidget *parent, const iString *initialValue, con | |||
525 | const char *prompt, const char *acceptLabel, const char *command) { | 525 | const char *prompt, const char *acceptLabel, const char *command) { |
526 | if (parent) { | 526 | if (parent) { |
527 | setFocus_Widget(NULL); | 527 | setFocus_Widget(NULL); |
528 | processEvents_App(postedEventsOnly_AppEventMode); | 528 | // processEvents_App(postedEventsOnly_AppEventMode); |
529 | } | 529 | } |
530 | iWidget *dlg = makeSheet_Widget(command); | 530 | iWidget *dlg = makeSheet_Widget(command); |
531 | setCommandHandler_Widget(dlg, valueInputHandler_); | 531 | setCommandHandler_Widget(dlg, valueInputHandler_); |
@@ -583,7 +583,7 @@ iWidget *makeQuestion_Widget(const char *title, | |||
583 | const char *labels[], | 583 | const char *labels[], |
584 | const char *commands[], | 584 | const char *commands[], |
585 | size_t count) { | 585 | size_t count) { |
586 | processEvents_App(postedEventsOnly_AppEventMode); | 586 | // processEvents_App(postedEventsOnly_AppEventMode); |
587 | iWidget *dlg = makeSheet_Widget(""); | 587 | iWidget *dlg = makeSheet_Widget(""); |
588 | setCommandHandler_Widget(dlg, messageHandler_); | 588 | setCommandHandler_Widget(dlg, messageHandler_); |
589 | addChild_Widget(dlg, iClob(new_LabelWidget(title, 0, 0, NULL))); | 589 | addChild_Widget(dlg, iClob(new_LabelWidget(title, 0, 0, NULL))); |