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
This commit is contained in:
@@ -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());
|
||||
|
||||
|
Reference in New Issue
Block a user