Show popup menu at cursor on wxQt if needed.

This commit is contained in:
Alex Shvartzkop 2024-02-12 18:06:40 +03:00
parent 57349c2aaa
commit 7a0149dfcb

View file

@ -1176,7 +1176,14 @@ void wxWindowQt::DoSetToolTip( wxToolTip *tip )
bool wxWindowQt::DoPopupMenu(wxMenu *menu, int x, int y)
{
menu->UpdateUI();
menu->GetHandle()->exec( GetHandle()->mapToGlobal( QPoint( x, y ) ) );
QPoint pt;
if (x == wxDefaultCoord && y == wxDefaultCoord)
pt = QCursor::pos();
else
pt = GetHandle()->mapToGlobal(QPoint(x, y));
menu->GetHandle()->exec(pt);
return true;
}