summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/app.c b/src/app.c
index 6bf62dc7..8c9dd6fe 100644
--- a/src/app.c
+++ b/src/app.c
@@ -244,8 +244,9 @@ const iString *execPath_App(void) {
244void processEvents_App(enum iAppEventMode eventMode) { 244void processEvents_App(enum iAppEventMode eventMode) {
245 iApp *d = &app_; 245 iApp *d = &app_;
246 SDL_Event ev; 246 SDL_Event ev;
247 while ((eventMode == waitForNewEvents_AppEventMode && SDL_WaitEvent(&ev)) || 247 while (
248 (eventMode == postedEventsOnly_AppEventMode && SDL_PollEvent(&ev))) { 248 (!d->pendingRefresh && eventMode == waitForNewEvents_AppEventMode && SDL_WaitEvent(&ev)) ||
249 ((d->pendingRefresh || eventMode == postedEventsOnly_AppEventMode) && SDL_PollEvent(&ev))) {
249 switch (ev.type) { 250 switch (ev.type) {
250 case SDL_QUIT: 251 case SDL_QUIT:
251 // if (isModified_Song(d->song)) { 252 // if (isModified_Song(d->song)) {
@@ -396,6 +397,7 @@ static const iString *historyUrl_App_(iApp *d, size_t pos) {
396} 397}
397 398
398static void printHistory_App_(const iApp *d) { 399static void printHistory_App_(const iApp *d) {
400#if 0
399 iConstForEach(Array, i, &d->history) { 401 iConstForEach(Array, i, &d->history) {
400 const size_t idx = index_ArrayConstIterator(&i); 402 const size_t idx = index_ArrayConstIterator(&i);
401 printf("%s[%zu]: %s\n", 403 printf("%s[%zu]: %s\n",
@@ -404,13 +406,14 @@ static void printHistory_App_(const iApp *d) {
404 cstr_String(&((const iHistoryItem *) i.value)->url)); 406 cstr_String(&((const iHistoryItem *) i.value)->url));
405 } 407 }
406 fflush(stdout); 408 fflush(stdout);
409#endif
407} 410}
408 411
409iBool handleCommand_App(const char *cmd) { 412iBool handleCommand_App(const char *cmd) {
410 iApp *d = &app_; 413 iApp *d = &app_;
411 iWidget *root = d->window->root; 414 iWidget *root = d->window->root;
412 if (equal_Command(cmd, "open")) { 415 if (equal_Command(cmd, "open")) {
413 const iString *url = collect_String(newCStr_String(valuePtr_Command(cmd, "url"))); 416 const iString *url = collect_String(newCStr_String(suffixPtr_Command(cmd, "url")));
414 if (!argLabel_Command(cmd, "history")) { 417 if (!argLabel_Command(cmd, "history")) {
415 if (argLabel_Command(cmd, "redirect")) { 418 if (argLabel_Command(cmd, "redirect")) {
416 /* Update in the history. */ 419 /* Update in the history. */