Ignore some mouse events sent from scrollbar to GUITable
authorKahrl <kahrl@gmx.net>
Sat, 6 Dec 2014 21:45:20 +0000 (22:45 +0100)
committerKahrl <kahrl@gmx.net>
Sat, 6 Dec 2014 21:45:23 +0000 (22:45 +0100)
Fixes #1567, #1806.

src/guiTable.cpp

index 845c90122c51675f7d06383b6c3af6f743c7aca6..153d0010604580d392787d316b15fb520d69801b 100644 (file)
@@ -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)) {