diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-09-23 22:08:36 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-09-23 22:08:36 +0300 |
commit | 1d4402e7ee9f208232227ded6add865b67e849af (patch) | |
tree | 5662c54ce2ec41bcf65ff3653da5c725d4767e5d /src | |
parent | ec4c5eafb0998640a70d96e4c64f12565476b8b6 (diff) |
MainWindow: Tweaks to avoid flash at launch
When the window appears, it should have all the actual contents and not a placeholder.
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/window.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/ui/window.c b/src/ui/window.c index 8197afd4..0863aa47 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -561,6 +561,7 @@ void init_MainWindow(iMainWindow *d, iRect rect) { | |||
561 | SDL_EventState(SDL_SYSWMEVENT, SDL_TRUE); | 561 | SDL_EventState(SDL_SYSWMEVENT, SDL_TRUE); |
562 | } | 562 | } |
563 | #endif | 563 | #endif |
564 | SDL_HideWindow(d->base.win); | ||
564 | } | 565 | } |
565 | 566 | ||
566 | void deinit_MainWindow(iMainWindow *d) { | 567 | void deinit_MainWindow(iMainWindow *d) { |
@@ -731,14 +732,11 @@ static iBool handleWindowEvent_MainWindow_(iMainWindow *d, const SDL_WindowEvent | |||
731 | switch (ev->event) { | 732 | switch (ev->event) { |
732 | #if defined(iPlatformDesktop) | 733 | #if defined(iPlatformDesktop) |
733 | case SDL_WINDOWEVENT_EXPOSED: | 734 | case SDL_WINDOWEVENT_EXPOSED: |
734 | if (!d->base.isExposed) { | 735 | d->base.isExposed = iTrue; |
735 | drawBlank_Window_(as_Window(d)); /* avoid showing system-provided contents */ | ||
736 | d->base.isExposed = iTrue; | ||
737 | } | ||
738 | /* Since we are manually controlling when to redraw the window, we are responsible | 736 | /* Since we are manually controlling when to redraw the window, we are responsible |
739 | for ensuring that window contents get redrawn after expose events. Under certain | 737 | for ensuring that window contents get redrawn after expose events. Under certain |
740 | circumstances (e.g., under openbox), not doing this would mean that the window | 738 | circumstances (e.g., under openbox), not doing this would mean that the window |
741 | is missing contents until other events trigger a refresh. */ | 739 | is missing contents until other events trigger a refresh. */ |
742 | postRefresh_App(); | 740 | postRefresh_App(); |
743 | #if defined(LAGRANGE_ENABLE_WINDOWPOS_FIX) | 741 | #if defined(LAGRANGE_ENABLE_WINDOWPOS_FIX) |
744 | if (d->place.initialPos.x >= 0) { | 742 | if (d->place.initialPos.x >= 0) { |
@@ -918,7 +916,7 @@ iBool processEvent_Window(iWindow *d, const SDL_Event *ev) { | |||
918 | if (SDL_GetWindowFlags(d->win) & SDL_WINDOW_HIDDEN) { | 916 | if (SDL_GetWindowFlags(d->win) & SDL_WINDOW_HIDDEN) { |
919 | SDL_ShowWindow(d->win); | 917 | SDL_ShowWindow(d->win); |
920 | } | 918 | } |
921 | postRefresh_App(); | 919 | draw_MainWindow(mw); /* don't show a frame of placeholder content */ |
922 | postCommand_App("media.player.update"); /* in case a player needs updating */ | 920 | postCommand_App("media.player.update"); /* in case a player needs updating */ |
923 | return iTrue; | 921 | return iTrue; |
924 | } | 922 | } |