From 4b86e4bdd0af89b0dacd303644b4bce5c7e67f92 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 22 May 2025 09:09:55 +0200 Subject: [PATCH] [client,sdl] fix hidden dialog update --- client/SDL/SDL3/dialogs/sdl_input_widget_pair_list.cpp | 4 ++-- client/SDL/SDL3/dialogs/sdl_widget_list.cpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/client/SDL/SDL3/dialogs/sdl_input_widget_pair_list.cpp b/client/SDL/SDL3/dialogs/sdl_input_widget_pair_list.cpp index f55548c04..9c2f3882d 100644 --- a/client/SDL/SDL3/dialogs/sdl_input_widget_pair_list.cpp +++ b/client/SDL/SDL3/dialogs/sdl_input_widget_pair_list.cpp @@ -293,8 +293,8 @@ int SdlInputWidgetPairList::run(std::vector& result) auto rc = SDL_RenderPresent(_renderer.get()); if (!rc) { - SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "SDL_RenderPresent failed with %s", - SDL_GetError()); + SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "[%s] SDL_RenderPresent failed with %s", + __func__, SDL_GetError()); } } diff --git a/client/SDL/SDL3/dialogs/sdl_widget_list.cpp b/client/SDL/SDL3/dialogs/sdl_widget_list.cpp index 042f80eac..15fd15fd2 100644 --- a/client/SDL/SDL3/dialogs/sdl_widget_list.cpp +++ b/client/SDL/SDL3/dialogs/sdl_widget_list.cpp @@ -44,6 +44,9 @@ bool SdlWidgetList::clearWindow() bool SdlWidgetList::update() { + if (!visible()) + return true; + clearWindow(); updateInternal(); if (!_buttons.update()) @@ -51,7 +54,7 @@ bool SdlWidgetList::update() auto rc = SDL_RenderPresent(_renderer.get()); if (!rc) { - SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "SDL_RenderPresent failed with %s", + SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "[%s] SDL_RenderPresent failed with %s", __func__, SDL_GetError()); } return rc;