]> git.saurik.com Git - wxWidgets.git/commitdiff
Detect when the window is still captured when dragging was aborted for some reason
authorJulian Smart <julian@anthemion.co.uk>
Tue, 8 Jan 2013 10:25:01 +0000 (10:25 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 8 Jan 2013 10:25:01 +0000 (10:25 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73355 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextctrl.cpp

index d4408a8b8a62fed7f7e5c3ec6055a035edac1889..06dbf17af1859795fe282e16e3ece03629c2fe8e 100644 (file)
@@ -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)