]> git.saurik.com Git - wxWidgets.git/commitdiff
Remove superfluous mouse capturing in wxGrid row/column labels windows.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 4 Sep 2013 00:14:13 +0000 (00:14 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 4 Sep 2013 00:14:13 +0000 (00:14 +0000)
This code recaptured the mouse in the window which had already had it, thus
triggering the (recently added, see r74677) asserts in CaptureMouse(). It also
didn't preserve the invariant of m_winCapture always having the capture. And
it was apparently completely unnecessary too.

So simply remove it to fix the asserts while drag-resizing wxGrid rows/columns.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74752 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index 38c1b9f92c5c8416d4cb07a17b3c3d9e2e7a71a1..c7a062946d920b3a2864cbd5aa1b6fe1d2074d10 100644 (file)
@@ -3266,10 +3266,7 @@ void wxGrid::ProcessRowLabelMouseEvent( wxMouseEvent& event )
     if ( event.Dragging() )
     {
         if (!m_isDragging)
-        {
             m_isDragging = true;
-            m_rowLabelWin->CaptureMouse();
-        }
 
         if ( event.LeftIsDown() )
         {
@@ -3319,11 +3316,7 @@ void wxGrid::ProcessRowLabelMouseEvent( wxMouseEvent& event )
         return;
 
     if (m_isDragging)
-    {
-        if (m_rowLabelWin->HasCapture())
-            m_rowLabelWin->ReleaseMouse();
         m_isDragging = false;
-    }
 
     // ------------ Entering or leaving the window
     //
@@ -3550,7 +3543,6 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event )
         if (!m_isDragging)
         {
             m_isDragging = true;
-            GetColLabelWindow()->CaptureMouse();
 
             if ( m_cursorMode == WXGRID_CURSOR_MOVE_COL && col != -1 )
                 DoStartMoveCol(col);
@@ -3641,11 +3633,7 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event )
         return;
 
     if (m_isDragging)
-    {
-        if (GetColLabelWindow()->HasCapture())
-            GetColLabelWindow()->ReleaseMouse();
         m_isDragging = false;
-    }
 
     // ------------ Entering or leaving the window
     //