Skip to content

Commit f3bfd94

Browse files
committed
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. See wxWidgets#24027, wxWidgets#24039. (cherry picked from commit f1a3816)
1 parent 4fab20c commit f3bfd94

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

docs/changes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ All:
242242

243243
All (GUI):
244244

245+
- Fix possible crash when dragging pages in wxAuiNotebook (#24027).
245246
- Fix refreshing multiple selection items in generic wxListCtrl.
246247

247248
wxGTK:

src/aui/auibook.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,6 +1099,7 @@ void wxAuiTabCtrl::OnCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(event))
10991099
{
11001100
if (m_isDragging)
11011101
{
1102+
m_clickPt = wxDefaultPosition;
11021103
m_isDragging = false;
11031104

11041105
wxAuiNotebookEvent evt(wxEVT_AUINOTEBOOK_CANCEL_DRAG, m_windowId);
@@ -1116,6 +1117,7 @@ void wxAuiTabCtrl::OnLeftUp(wxMouseEvent& evt)
11161117

11171118
if (m_isDragging)
11181119
{
1120+
m_clickPt = wxDefaultPosition;
11191121
m_isDragging = false;
11201122

11211123
wxAuiNotebookEvent e(wxEVT_AUINOTEBOOK_END_DRAG, m_windowId);

0 commit comments

Comments
 (0)