From c7ea5a0c7edbdb777640e2613bfaac5f649b3340 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 4 Sep 2013 00:14:13 +0000 Subject: [PATCH] Remove superfluous mouse capturing in wxGrid row/column labels windows. 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 | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 38c1b9f92c..c7a062946d 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -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 // -- 2.45.2