diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 0de2cc3969..a562f27636 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.5.6 (in development) ------------------------------------------------------------------------ - Fix: [#24457] Yellow is always rendered as third remap in Ride window. +- Fix: [#26754] Switching window tabs by touch could crash the game on some Linux builds. - Fix: [#27052] Unnamed rides in RCT2 base and Wacky Worlds scenarios have hardcoded English names. 0.5.5 (2026-09-06) diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 626e3cb631..3cdb1d4d1e 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -1024,6 +1024,11 @@ namespace OpenRCT2 if (w != nullptr) { w->onPrepareDraw(); + + // Switching a window to another page can leave the remembered index out of range. + if (static_cast(gHoverWidget.widgetIndex) >= w->widgets.size()) + return; + if (w->widgets[gHoverWidget.widgetIndex].type == WidgetType::flatBtn || w->widgets[gHoverWidget.widgetIndex].type == WidgetType::hiddenButton) {