From 3611a41e07fa1a9b0fbb09b8a7562ef577ce2e2c Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Wed, 22 Dec 2021 17:24:06 -0800 Subject: [PATCH] Set position for wxEVT_DATAVIEW_ITEM_CONTEXT_MENU with generic wxDataViewCtrl See #19188 --- src/generic/datavgen.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 2712368c6f..5d44626d47 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -4988,6 +4988,11 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) if (event.RightUp()) { wxDataViewEvent le(wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, m_owner, col, item); + int xx = event.GetX(); + int yy = event.GetY(); + ClientToScreen(&xx, &yy); + m_owner->ScreenToClient(&xx, &yy); + le.SetPosition(xx, yy); m_owner->ProcessWindowEvent(le); return; }