summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/app.c b/src/app.c
index 543467ef..55f1add7 100644
--- a/src/app.c
+++ b/src/app.c
@@ -1761,6 +1761,9 @@ void refresh_App(void) {
1761 /* Draw each window. */ 1761 /* Draw each window. */
1762 iConstForEach(PtrArray, j, &windows) { 1762 iConstForEach(PtrArray, j, &windows) {
1763 iWindow *win = j.ptr; 1763 iWindow *win = j.ptr;
1764 if (!d->warmupFrames && !exchange_Atomic(&win->isRefreshPending, iFalse)) {
1765 continue; /* No need to draw this window. */
1766 }
1764 setCurrent_Window(win); 1767 setCurrent_Window(win);
1765 switch (win->type) { 1768 switch (win->type) {
1766 case main_WindowType: { 1769 case main_WindowType: {
@@ -1775,6 +1778,7 @@ void refresh_App(void) {
1775 draw_Window(win); 1778 draw_Window(win);
1776 break; 1779 break;
1777 } 1780 }
1781 win->frameCount++;
1778 } 1782 }
1779 } 1783 }
1780 if (d->warmupFrames > 0) { 1784 if (d->warmupFrames > 0) {
@@ -1847,7 +1851,12 @@ void postRefresh_App(void) {
1847#if defined (LAGRANGE_ENABLE_IDLE_SLEEP) 1851#if defined (LAGRANGE_ENABLE_IDLE_SLEEP)
1848 d->isIdling = iFalse; 1852 d->isIdling = iFalse;
1849#endif 1853#endif
1850 const iBool wasPending = exchange_Atomic(&d->pendingRefresh, iTrue); 1854 iAtomicInt *pendingWindow = (get_Window() ? &get_Window()->isRefreshPending
1855 : NULL);
1856 iBool wasPending = exchange_Atomic(&d->pendingRefresh, iTrue);
1857 if (pendingWindow) {
1858 wasPending |= exchange_Atomic(pendingWindow, iTrue);
1859 }
1851 if (!wasPending) { 1860 if (!wasPending) {
1852 SDL_Event ev = { .type = SDL_USEREVENT }; 1861 SDL_Event ev = { .type = SDL_USEREVENT };
1853 ev.user.code = refresh_UserEventCode; 1862 ev.user.code = refresh_UserEventCode;