From d74eecff3bc4fc9371649cf57a4bad31a152e8b6 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Sun, 25 Jan 2026 20:27:50 +0100 Subject: [PATCH] [client,sdl] ignore set_mouseover result The function might return false if no item was selected. --- client/SDL/SDL3/dialogs/sdl_connection_dialog.cpp | 3 +-- client/SDL/SDL3/dialogs/sdl_input_widget_pair_list.cpp | 9 +++------ client/SDL/SDL3/dialogs/sdl_select_list.cpp | 3 +-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/client/SDL/SDL3/dialogs/sdl_connection_dialog.cpp b/client/SDL/SDL3/dialogs/sdl_connection_dialog.cpp index a4d9773d8..3286b24aa 100644 --- a/client/SDL/SDL3/dialogs/sdl_connection_dialog.cpp +++ b/client/SDL/SDL3/dialogs/sdl_connection_dialog.cpp @@ -226,8 +226,7 @@ bool SDLConnectionDialog::handle(const SDL_Event& event) { auto& ev = reinterpret_cast(event); - if (!_buttons.set_mouseover(event.button.x, event.button.y)) - return false; + _buttons.set_mouseover(event.button.x, event.button.y); if (!update()) return false; return windowID == ev.windowID; 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 08b4cfd77..2bfb9c1c0 100644 --- a/client/SDL/SDL3/dialogs/sdl_input_widget_pair_list.cpp +++ b/client/SDL/SDL3/dialogs/sdl_input_widget_pair_list.cpp @@ -236,18 +236,15 @@ int SdlInputWidgetPairList::run(std::vector& result) auto TextInputIndex = get_index(event.button); for (auto& cur : m_list) { - if (!cur->set_mouseover(false)) - throw; + cur->set_mouseover(false); } if (TextInputIndex >= 0) { auto& cur = m_list[static_cast(TextInputIndex)]; - if (!cur->set_mouseover(true)) - throw; + cur->set_mouseover(true); } - if (!_buttons.set_mouseover(event.button.x, event.button.y)) - throw; + _buttons.set_mouseover(event.button.x, event.button.y); } break; case SDL_EVENT_MOUSE_BUTTON_DOWN: diff --git a/client/SDL/SDL3/dialogs/sdl_select_list.cpp b/client/SDL/SDL3/dialogs/sdl_select_list.cpp index a4cebfe15..751ae2d99 100644 --- a/client/SDL/SDL3/dialogs/sdl_select_list.cpp +++ b/client/SDL/SDL3/dialogs/sdl_select_list.cpp @@ -111,8 +111,7 @@ int SdlSelectList::run() throw; } - if (!_buttons.set_mouseover(event.button.x, event.button.y)) - throw; + _buttons.set_mouseover(event.button.x, event.button.y); } break; case SDL_EVENT_MOUSE_BUTTON_DOWN: