diff --git a/src/osdep/gui/ShowHelp.cpp b/src/osdep/gui/ShowHelp.cpp index 82c8a7ab..1f92db64 100644 --- a/src/osdep/gui/ShowHelp.cpp +++ b/src/osdep/gui/ShowHelp.cpp @@ -226,6 +226,17 @@ void ShowHelp(const char* title, const vector& text) wndShowHelp->setCaption(title); cmdOK->setCaption("Ok"); + + // Now we let the Gui object perform its logic. + uae_gui->logic(); + // Now we let the Gui object draw itself. + uae_gui->draw(); +#ifdef USE_SDL2 + SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch); +#endif + UpdateGuiScreen(); + ShowHelpLoop(); + ExitShowHelp(); } diff --git a/src/osdep/gui/ShowMessage.cpp b/src/osdep/gui/ShowMessage.cpp index 60aa0e3c..1e9687bf 100644 --- a/src/osdep/gui/ShowMessage.cpp +++ b/src/osdep/gui/ShowMessage.cpp @@ -183,11 +183,13 @@ static void ShowMessageLoop() { FocusBugWorkaround(wndShowMessage); + int gotEvent = 0; while (!dialogFinished) { SDL_Event event; while (SDL_PollEvent(&event)) { + gotEvent = 1; if (event.type == SDL_KEYDOWN) { switch (event.key.keysym.sym) @@ -251,13 +253,17 @@ static void ShowMessageLoop() gui_input->pushInput(event); #endif } - - // Now we let the Gui object perform its logic. - uae_gui->logic(); - // Now we let the Gui object draw itself. - uae_gui->draw(); + if (gotEvent) + { + // Now we let the Gui object perform its logic. + uae_gui->logic(); + // Now we let the Gui object draw itself. + uae_gui->draw(); +#ifdef USE_SDL2 + SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch); +#endif + } // Finally we update the screen. - UpdateGuiScreen(); } } @@ -281,7 +287,17 @@ bool ShowMessage(const char* title, const char* line1, const char* line2, const cmdOK->setPosition(cmdCancel->getX(), cmdCancel->getY()); } cmdOK->setEnabled(true); + + // Prepare the screen once + uae_gui->logic(); + uae_gui->draw(); +#ifdef USE_SDL2 + SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch); +#endif + UpdateGuiScreen(); + ShowMessageLoop(); + ExitShowMessage(); return dialogResult; @@ -298,7 +314,16 @@ const char* ShowMessageForInput(const char* title, const char* line1, const char cmdOK->setVisible(false); cmdCancel->setCaption(button1); + // Prepare the screen once + uae_gui->logic(); + uae_gui->draw(); +#ifdef USE_SDL2 + SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch); +#endif + UpdateGuiScreen(); + ShowMessageWaitInputLoop(); + ExitShowMessage(); return dialogControlPressed;