From a8af0c0ca47c91eea09cbc77b104411f5e22a513 Mon Sep 17 00:00:00 2001 From: grorp Date: Fri, 10 May 2024 18:54:22 +0200 Subject: [PATCH] Close buttonbars when hiding TouchScreenGUI (#14630) To open the inventory or the pause menu, you first need to open the buttonbar containing the respective button. Before this commit, the buttonbar is still open after closing the menu, so you have to tap twice before you can continue playing. After this commit, the buttonbar is already closed after closing the menu, so you only have to tap once before you can continue playing. --- src/gui/touchscreengui.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/touchscreengui.cpp b/src/gui/touchscreengui.cpp index 2a2fa36ed..2504c4eb5 100644 --- a/src/gui/touchscreengui.cpp +++ b/src/gui/touchscreengui.cpp @@ -857,8 +857,10 @@ void TouchScreenGUI::setVisible(bool visible) if (!visible) { while (!m_pointer_pos.empty()) handleReleaseEvent(m_pointer_pos.begin()->first); - for (AutoHideButtonBar &bar : m_buttonbars) + for (AutoHideButtonBar &bar : m_buttonbars) { + bar.deactivate(); bar.hide(); + } } else { for (AutoHideButtonBar &bar : m_buttonbars) bar.show();