From: Julian Smart Date: Tue, 8 Jan 2013 10:25:01 +0000 (+0000) Subject: Detect when the window is still captured when dragging was aborted for some reason X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f5613c9b12d97846e2f63bf7569082cbbf5ae845?hp=52682336e8b619044682102d16f22a058f5b2a59 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 --- 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)