From c8aaa4df1abb63c59bdaa06652a52270783cbe56 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 28 Nov 2020 08:37:06 +0200 Subject: Windows: Refreshing window contents during window resizing SDL clears all buffered rendertargets so we must redraw everything. --- src/app.c | 9 +++++++++ src/ui/window.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app.c b/src/app.c index 419c5619..5d22c1dc 100644 --- a/src/app.c +++ b/src/app.c @@ -570,6 +570,15 @@ static int resizeWatcher_(void *user, SDL_Event *event) { iApp *d = user; if (event->type == SDL_WINDOWEVENT && event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { const SDL_WindowEvent *winev = &event->window; +#if defined (iPlatformMsys) + resetFonts_Text(); { + SDL_Event u = { .type = SDL_USEREVENT }; + u.user.code = command_UserEventCode; + u.user.data1 = strdup("theme.changed"); + u.user.windowID = SDL_GetWindowID(d->window->win); + dispatchEvent_Widget(d->window->root, &u); + } +#endif drawWhileResizing_Window(d->window, winev->data1, winev->data2); } return 0; diff --git a/src/ui/window.c b/src/ui/window.c index dd9181ad..dadfae6d 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -528,7 +528,7 @@ static void updateRootSize_Window_(iWindow *d, iBool notifyAlways) { void drawWhileResizing_Window(iWindow *d, int w, int h) { /* This is called while a window resize is in progress, so we can be pretty confident the size has actually changed. */ - d->root->rect.size = mulf_I2(init_I2(w, h), d->pixelRatio); + d->root->rect.size = coord_Window(d, w, h); arrange_Widget(d->root); draw_Window(d); } -- cgit v1.2.3