Fix crash in wxAuiNotebook after dragging a page
Fix using outdated click position in wxAuiTabCtrl mouse handlers, which resulted in an invalid wxEVT_AUINOTEBOOK_DRAG_MOTION event being generated and a crash while handling it. Ensure that we reset m_clickPt when resetting m_isDragging too so that we don't decide that we're dragging if the mouse enters the window with the left button already pressed after a previous drag. Closes #24027.
This commit is contained in:
parent
4ddea5658d
commit
f1a3816cd9
1 changed files with 2 additions and 0 deletions
|
|
@ -1099,6 +1099,7 @@ void wxAuiTabCtrl::OnCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(event))
|
|||
{
|
||||
if (m_isDragging)
|
||||
{
|
||||
m_clickPt = wxDefaultPosition;
|
||||
m_isDragging = false;
|
||||
|
||||
wxAuiNotebookEvent evt(wxEVT_AUINOTEBOOK_CANCEL_DRAG, m_windowId);
|
||||
|
|
@ -1116,6 +1117,7 @@ void wxAuiTabCtrl::OnLeftUp(wxMouseEvent& evt)
|
|||
|
||||
if (m_isDragging)
|
||||
{
|
||||
m_clickPt = wxDefaultPosition;
|
||||
m_isDragging = false;
|
||||
|
||||
wxAuiNotebookEvent e(wxEVT_AUINOTEBOOK_END_DRAG, m_windowId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue