aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2014-12-06 22:45:20 +0100
committerKahrl <kahrl@gmx.net>2014-12-06 22:45:23 +0100
commitf3abaec83be741094ef1b0949e3400fb16729f97 (patch)
treeb699adf4ddb7842f5c76cf26bee94f058d381bb5
parentd75f0b0360daeb81dd574756845160745dfecacd (diff)
downloadminetest-f3abaec83be741094ef1b0949e3400fb16729f97.tar.gz
minetest-f3abaec83be741094ef1b0949e3400fb16729f97.tar.bz2
minetest-f3abaec83be741094ef1b0949e3400fb16729f97.zip
Ignore some mouse events sent from scrollbar to GUITable
Fixes #1567, #1806.
-rw-r--r--src/guiTable.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/guiTable.cpp b/src/guiTable.cpp
index 845c90122..153d00106 100644
--- a/src/guiTable.cpp
+++ b/src/guiTable.cpp
@@ -862,6 +862,14 @@ bool GUITable::OnEvent(const SEvent &event)
// Update tooltip
setToolTipText(cell ? m_strings[cell->tooltip_index].c_str() : L"");
+ // Fix for #1567/#1806:
+ // IGUIScrollBar passes double click events to its parent,
+ // which we don't want. Detect this case and discard the event
+ if (event.MouseInput.Event != EMIE_MOUSE_MOVED &&
+ m_scrollbar->isVisible() &&
+ m_scrollbar->isPointInside(p))
+ return true;
+
if (event.MouseInput.isLeftPressed() &&
(isPointInside(p) ||
event.MouseInput.Event == EMIE_MOUSE_MOVED)) {