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