Fix cursor still visible after closing formspec while on HyperText (#9583)
authorPierre-Yves Rollo <dev@pyrollo.com>
Sat, 4 Apr 2020 14:17:15 +0000 (16:17 +0200)
committerGitHub <noreply@github.com>
Sat, 4 Apr 2020 14:17:15 +0000 (16:17 +0200)
src/gui/guiHyperText.cpp

index 482b74f046d1ef00ed9b772745c9be2b979588a2..85e562dad1922e7ea41acbe8fcd644bd2822e96b 100644 (file)
@@ -1054,12 +1054,14 @@ void GUIHyperText::checkHover(s32 X, s32 Y)
                }
        }
 
+#ifndef HAVE_TOUCHSCREENGUI
        if (m_drawer.m_hovertag)
                RenderingEngine::get_raw_device()->getCursorControl()->setActiveIcon(
                                gui::ECI_HAND);
        else
                RenderingEngine::get_raw_device()->getCursorControl()->setActiveIcon(
                                gui::ECI_NORMAL);
+#endif
 }
 
 bool GUIHyperText::OnEvent(const SEvent &event)
@@ -1075,8 +1077,12 @@ bool GUIHyperText::OnEvent(const SEvent &event)
        if (event.EventType == EET_GUI_EVENT &&
                        event.GUIEvent.EventType == EGET_ELEMENT_LEFT) {
                m_drawer.m_hovertag = nullptr;
-               RenderingEngine::get_raw_device()->getCursorControl()->setActiveIcon(
-                               gui::ECI_NORMAL);
+#ifndef HAVE_TOUCHSCREENGUI
+               gui::ICursorControl *cursor_control =
+                               RenderingEngine::get_raw_device()->getCursorControl();
+               if (cursor_control->isVisible())
+                       cursor_control->setActiveIcon(gui::ECI_NORMAL);
+#endif
        }
 
        if (event.EventType == EET_MOUSE_INPUT_EVENT) {