aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Yves Rollo <dev@pyrollo.com>2020-04-04 16:17:15 +0200
committerGitHub <noreply@github.com>2020-04-04 16:17:15 +0200
commit86a0e991efff2fc616372f566a301352be28dae9 (patch)
treee846dbf8c6609c9fa962b033efc1d2a833f142b5
parent307d7376cf88f3ef30a73f4500971e3a77977068 (diff)
downloadminetest-86a0e991efff2fc616372f566a301352be28dae9.tar.gz
minetest-86a0e991efff2fc616372f566a301352be28dae9.tar.bz2
minetest-86a0e991efff2fc616372f566a301352be28dae9.zip
Fix cursor still visible after closing formspec while on HyperText (#9583)
-rw-r--r--src/gui/guiHyperText.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/guiHyperText.cpp b/src/gui/guiHyperText.cpp
index 482b74f04..85e562dad 100644
--- a/src/gui/guiHyperText.cpp
+++ b/src/gui/guiHyperText.cpp
@@ -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) {