Handle double clicks in the map as simple clicks

This is much more useful than ignoring them as some clicks in a series
of clicks could be unintentionally lost/ignored before.
This commit is contained in:
Vadim Zeitlin
2025-08-26 00:26:55 +02:00
parent 86e0b4db63
commit 5089cbc1ff
+8 -5
View File
@@ -962,7 +962,9 @@ public:
});
// Handle mouse events for dragging the visible zone indicator.
Bind(wxEVT_LEFT_DOWN, &wxStyledTextCtrlMap::OnLeftDown, this);
Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& event) {
HandleMouseClick(event);
});
Bind(wxEVT_MOTION, [this](wxMouseEvent& event) {
if ( event.LeftIsDown() && IsDragging() )
@@ -974,9 +976,10 @@ public:
DoStopDragging();
});
Bind(wxEVT_LEFT_DCLICK, [this](wxMouseEvent& WXUNUSED(event)) {
// Don't let Scintilla get the double click, even if we don't do
// anything with it ourselves.
Bind(wxEVT_LEFT_DCLICK, [this](wxMouseEvent& event) {
// Don't let Scintilla get the double click, handle it as a simple
// click instead.
HandleMouseClick(event);
});
Bind(wxEVT_MOUSE_CAPTURE_LOST, [this](wxMouseCaptureLostEvent& WXUNUSED(event)) {
@@ -1208,7 +1211,7 @@ private:
return m_dragOffset != -1;
}
void OnLeftDown(wxMouseEvent& event)
void HandleMouseClick(wxMouseEvent& event)
{
auto const posMouse = event.GetPosition();
auto const line = GetMapLineAtPoint(posMouse);