diff options
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -126,6 +126,7 @@ struct Impl_App { | |||
126 | iStringList *launchCommands; | 126 | iStringList *launchCommands; |
127 | iBool isFinishedLaunching; | 127 | iBool isFinishedLaunching; |
128 | iTime lastDropTime; /* for detecting drops of multiple items */ | 128 | iTime lastDropTime; /* for detecting drops of multiple items */ |
129 | int autoReloadTimer; | ||
129 | /* Preferences: */ | 130 | /* Preferences: */ |
130 | iBool commandEcho; /* --echo */ | 131 | iBool commandEcho; /* --echo */ |
131 | iBool forceSoftwareRender; /* --sw */ | 132 | iBool forceSoftwareRender; /* --sw */ |
@@ -414,6 +415,12 @@ static uint32_t checkAsleep_App_(uint32_t interval, void *param) { | |||
414 | } | 415 | } |
415 | #endif | 416 | #endif |
416 | 417 | ||
418 | static uint32_t postAutoReloadCommand_App_(uint32_t interval, void *param) { | ||
419 | iUnused(param); | ||
420 | postCommand_App("document.autoreload"); | ||
421 | return interval; | ||
422 | } | ||
423 | |||
417 | static void init_App_(iApp *d, int argc, char **argv) { | 424 | static void init_App_(iApp *d, int argc, char **argv) { |
418 | init_CommandLine(&d->args, argc, argv); | 425 | init_CommandLine(&d->args, argc, argv); |
419 | /* Where was the app started from? We ask SDL first because the command line alone is | 426 | /* Where was the app started from? We ask SDL first because the command line alone is |
@@ -512,7 +519,9 @@ static void init_App_(iApp *d, int argc, char **argv) { | |||
512 | postCommand_App("open url:about:help"); | 519 | postCommand_App("open url:about:help"); |
513 | } | 520 | } |
514 | postCommand_App("window.unfreeze"); | 521 | postCommand_App("window.unfreeze"); |
515 | d->isFinishedLaunching = iTrue; | 522 | d->autoReloadTimer = SDL_AddTimer(60 * 1000, postAutoReloadCommand_App_, NULL); |
523 | postCommand_App("document.autoreload"); | ||
524 | d->isFinishedLaunching = iTrue; | ||
516 | /* Run any commands that were pending completion of launch. */ { | 525 | /* Run any commands that were pending completion of launch. */ { |
517 | iForEach(StringList, i, d->launchCommands) { | 526 | iForEach(StringList, i, d->launchCommands) { |
518 | postCommandString_App(i.value); | 527 | postCommandString_App(i.value); |