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.

Closes #16327.

(this is a forward port of 648d9ce1fbd6d4f2241eda764f2a9679aed6b2c4 from 3.0)
This commit is contained in:
Vadim Zeitlin 2014-06-22 21:36:24 +00:00
parent 71dfb3b414
commit 11f6ecce6b

View File

@ -2673,6 +2673,9 @@ void wxAuiToolBar::OnLeftUp(wxMouseEvent& evt)
void wxAuiToolBar::OnRightDown(wxMouseEvent& evt)
{
if (HasCapture())
return;
wxRect cli_rect(wxPoint(0,0), GetClientSize());
if (m_gripperSizerItem)
@ -2709,6 +2712,9 @@ void wxAuiToolBar::OnRightDown(wxMouseEvent& evt)
void wxAuiToolBar::OnRightUp(wxMouseEvent& evt)
{
if (HasCapture())
return;
wxAuiToolBarItem* hitItem;
hitItem = FindToolByPosition(evt.GetX(), evt.GetY());
@ -2739,6 +2745,9 @@ void wxAuiToolBar::OnRightUp(wxMouseEvent& evt)
void wxAuiToolBar::OnMiddleDown(wxMouseEvent& evt)
{
if (HasCapture())
return;
wxRect cli_rect(wxPoint(0,0), GetClientSize());
if (m_gripperSizerItem)
@ -2778,6 +2787,9 @@ void wxAuiToolBar::OnMiddleDown(wxMouseEvent& evt)
void wxAuiToolBar::OnMiddleUp(wxMouseEvent& evt)
{
if (HasCapture())
return;
wxAuiToolBarItem* hitItem;
hitItem = FindToolByPosition(evt.GetX(), evt.GetY());