From f5613c9b12d97846e2f63bf7569082cbbf5ae845 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 8 Jan 2013 10:25:01 +0000 Subject: [PATCH] Detect when the window is still captured when dragging was aborted for some reason git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73355 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextctrl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index d4408a8b8a..06dbf17af1 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -751,6 +751,14 @@ void wxRichTextCtrl::OnLeftUp(wxMouseEvent& event) /// Mouse-movements void wxRichTextCtrl::OnMoveMouse(wxMouseEvent& event) { + if (!event.Dragging() && m_dragging) + { + // We may have accidentally lost a mouse-up event, especially on Linux + m_dragging = false; + if (GetCapture() == this) + ReleaseMouse(); + } + #if wxUSE_DRAG_AND_DROP size_t distance = 0; if (m_preDrag || m_dragging) -- 2.45.2