diff --git a/client/SDL/dialogs/sdl_connection_dialog.cpp b/client/SDL/dialogs/sdl_connection_dialog.cpp index 56c385342..fa638591d 100644 --- a/client/SDL/dialogs/sdl_connection_dialog.cpp +++ b/client/SDL/dialogs/sdl_connection_dialog.cpp @@ -49,7 +49,11 @@ SDLConnectionDialog::~SDLConnectionDialog() bool SDLConnectionDialog::visible() const { - return _window && _renderer; + if (!_window || !_renderer) + return false; + + auto flags = SDL_GetWindowFlags(_window); + return (flags & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED)) == 0; } bool SDLConnectionDialog::setTitle(const char* fmt, ...) diff --git a/client/SDL/dialogs/sdl_input_widgets.cpp b/client/SDL/dialogs/sdl_input_widgets.cpp index 58463082b..99e5270b8 100644 --- a/client/SDL/dialogs/sdl_input_widgets.cpp +++ b/client/SDL/dialogs/sdl_input_widgets.cpp @@ -164,10 +164,7 @@ int SdlInputWidgetList::run(std::vector& result) { auto it = std::remove(pressed.begin(), pressed.end(), event.key.keysym.sym); pressed.erase(it, pressed.end()); - } - break; - case SDL_KEYDOWN: - pressed.push_back(event.key.keysym.sym); + switch (event.key.keysym.sym) { case SDLK_BACKSPACE: @@ -210,6 +207,10 @@ int SdlInputWidgetList::run(std::vector& result) default: break; } + } + break; + case SDL_KEYDOWN: + pressed.push_back(event.key.keysym.sym); break; case SDL_TEXTINPUT: {