Fix position of popup menus in wxGenericListCtrl

The position was off by the header height due to a missing translation
between wxGenericListCtrl and wxListMainWindow, in which the menu is
actually shown, coordinates.

Closes #18133.
This commit is contained in:
Vadim Zeitlin 2018-05-16 15:23:00 +02:00
parent 67cb0ad260
commit 0446382e82

View File

@ -5467,6 +5467,12 @@ wxColour wxGenericListCtrl::GetForegroundColour() const
bool wxGenericListCtrl::DoPopupMenu( wxMenu *menu, int x, int y )
{
#if wxUSE_MENUS
// Coordinates here are given in this control coordinates system, but
// PopupMenu() wants them in the coordinates system of the window it's
// called on, so transform them.
ClientToScreen(&x, &y);
m_mainWin->ScreenToClient(&x, &y);
return m_mainWin->PopupMenu( menu, x, y );
#else
return false;