summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ui/text.c8
-rw-r--r--src/ui/window.c9
2 files changed, 12 insertions, 5 deletions
diff --git a/src/ui/text.c b/src/ui/text.c
index 3d208b68..04bb17a2 100644
--- a/src/ui/text.c
+++ b/src/ui/text.c
@@ -488,11 +488,11 @@ static void cache_Font_(iFont *d, iGlyph *glyph, int hoff) {
488 SDL_SetTextureBlendMode(tex, SDL_BLENDMODE_NONE); 488 SDL_SetTextureBlendMode(tex, SDL_BLENDMODE_NONE);
489 glRect->size = init_I2(surface->w, surface->h); 489 glRect->size = init_I2(surface->w, surface->h);
490 } 490 }
491 /* Determine placement in the glyph cache texture, advancing in rows. */
492 glRect->pos = assignCachePos_Text_(txt, glRect->size);
493 const SDL_Rect dstRect = sdlRect_(*glRect);
494 SDL_RenderCopy(render, tex, &(SDL_Rect){ 0, 0, dstRect.w, dstRect.h }, &dstRect);
495 if (tex) { 491 if (tex) {
492 /* Determine placement in the glyph cache texture, advancing in rows. */
493 glRect->pos = assignCachePos_Text_(txt, glRect->size);
494 const SDL_Rect dstRect = sdlRect_(*glRect);
495 SDL_RenderCopy(render, tex, &(SDL_Rect){ 0, 0, dstRect.w, dstRect.h }, &dstRect);
496 SDL_DestroyTexture(tex); 496 SDL_DestroyTexture(tex);
497 iAssert(surface); 497 iAssert(surface);
498 SDL_FreeSurface(surface); 498 SDL_FreeSurface(surface);
diff --git a/src/ui/window.c b/src/ui/window.c
index 8aa701e3..2b2dae46 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -515,7 +515,7 @@ static void drawBlank_Window_(iWindow *d) {
515} 515}
516 516
517iBool create_Window_(iWindow *d, iRect rect, uint32_t flags) { 517iBool create_Window_(iWindow *d, iRect rect, uint32_t flags) {
518 flags |= SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI; 518 flags |= SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_HIDDEN;
519 if (SDL_CreateWindowAndRenderer( 519 if (SDL_CreateWindowAndRenderer(
520 width_Rect(rect), height_Rect(rect), flags, &d->win, &d->render)) { 520 width_Rect(rect), height_Rect(rect), flags, &d->win, &d->render)) {
521 return iFalse; 521 return iFalse;
@@ -711,6 +711,13 @@ iBool processEvent_Window(iWindow *d, const SDL_Event *ev) {
711 SDL_Event event = *ev; 711 SDL_Event event = *ev;
712 if (event.type == SDL_USEREVENT && isCommand_UserEvent(ev, "window.unfreeze")) { 712 if (event.type == SDL_USEREVENT && isCommand_UserEvent(ev, "window.unfreeze")) {
713 d->isDrawFrozen = iFalse; 713 d->isDrawFrozen = iFalse;
714 /* When the window is shown for the first time, ensure glyphs get
715 re-cached correctly. */
716 if (SDL_GetWindowFlags(d->win) & SDL_WINDOW_HIDDEN) {
717 SDL_ShowWindow(d->win);
718 resetFonts_Text();
719 postCommand_App("theme.changed");
720 }
714 postRefresh_App(); 721 postRefresh_App();
715 return iTrue; 722 return iTrue;
716 } 723 }