diff options
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -566,10 +566,20 @@ static void runTickers_App_(iApp *d) { | |||
566 | } | 566 | } |
567 | } | 567 | } |
568 | 568 | ||
569 | static int resizeWatcher_(void *user, SDL_Event *event) { | ||
570 | iApp *d = user; | ||
571 | if (event->type == SDL_WINDOWEVENT && event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { | ||
572 | const SDL_WindowEvent *winev = &event->window; | ||
573 | drawWhileResizing_Window(d->window, winev->data1, winev->data2); | ||
574 | } | ||
575 | return 0; | ||
576 | } | ||
577 | |||
569 | static int run_App_(iApp *d) { | 578 | static int run_App_(iApp *d) { |
570 | arrange_Widget(findWidget_App("root")); | 579 | arrange_Widget(findWidget_App("root")); |
571 | d->running = iTrue; | 580 | d->running = iTrue; |
572 | SDL_EventState(SDL_DROPFILE, SDL_ENABLE); /* open files via drag'n'drop */ | 581 | SDL_EventState(SDL_DROPFILE, SDL_ENABLE); /* open files via drag'n'drop */ |
582 | SDL_AddEventWatch(resizeWatcher_, d); | ||
573 | while (d->running) { | 583 | while (d->running) { |
574 | processEvents_App(waitForNewEvents_AppEventMode); | 584 | processEvents_App(waitForNewEvents_AppEventMode); |
575 | runTickers_App_(d); | 585 | runTickers_App_(d); |