From 648d9ce1fbd6d4f2241eda764f2a9679aed6b2c4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 22 Jun 2014 21:36:24 +0000 Subject: [PATCH] Fix crash when right clicking AUI toolbar while left button is pressed. Ignore the unrelated mouse events during the item dragging. This avoids a crash due to m_actionItem being NULL when right clicking an item while the left mouse button is kept pressed. See #16327. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76746 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibar.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index 89df63007c..96707599fd 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -2669,6 +2669,9 @@ void wxAuiToolBar::OnLeftUp(wxMouseEvent& evt) void wxAuiToolBar::OnRightDown(wxMouseEvent& evt) { + if (HasCapture()) + return; + wxRect cli_rect(wxPoint(0,0), GetClientSize()); if (m_gripperSizerItem) @@ -2705,6 +2708,9 @@ void wxAuiToolBar::OnRightDown(wxMouseEvent& evt) void wxAuiToolBar::OnRightUp(wxMouseEvent& evt) { + if (HasCapture()) + return; + wxAuiToolBarItem* hitItem; hitItem = FindToolByPosition(evt.GetX(), evt.GetY()); @@ -2735,6 +2741,9 @@ void wxAuiToolBar::OnRightUp(wxMouseEvent& evt) void wxAuiToolBar::OnMiddleDown(wxMouseEvent& evt) { + if (HasCapture()) + return; + wxRect cli_rect(wxPoint(0,0), GetClientSize()); if (m_gripperSizerItem) @@ -2774,6 +2783,9 @@ void wxAuiToolBar::OnMiddleDown(wxMouseEvent& evt) void wxAuiToolBar::OnMiddleUp(wxMouseEvent& evt) { + if (HasCapture()) + return; + wxAuiToolBarItem* hitItem; hitItem = FindToolByPosition(evt.GetX(), evt.GetY());