Fix position for wxContextMenuEvent generated from keyboard
The position was wrong for the keyboard-triggered menu events in wxWindows containing multiple sub-windows, such as wxListCtrl. Closes https://github.com/wxWidgets/wxWidgets/pull/1352
This commit is contained in:
parent
71ad73fdbe
commit
0c7f261c4a
@ -1568,7 +1568,11 @@ bool wxWindowQt::QtHandleCloseEvent ( QWidget *handler, QCloseEvent *WXUNUSED( e
|
||||
bool wxWindowQt::QtHandleContextMenuEvent ( QWidget *WXUNUSED( handler ), QContextMenuEvent *event )
|
||||
{
|
||||
wxContextMenuEvent e( wxEVT_CONTEXT_MENU, GetId() );
|
||||
e.SetPosition( wxQtConvertPoint( event->globalPos() ) );
|
||||
e.SetPosition(
|
||||
event->reason() == QContextMenuEvent::Keyboard
|
||||
? wxDefaultPosition
|
||||
: wxQtConvertPoint( event->globalPos() )
|
||||
);
|
||||
e.SetEventObject(this);
|
||||
|
||||
return ProcessWindowEvent( e );
|
||||
|
Loading…
Reference in New Issue
Block a user