From 5986584fc066801dd452bfa5bb63f1e0c4e380e0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 1 Mar 2020 02:02:34 +0100 Subject: [PATCH] Fix position in dummy wxMouseEvent used by wxGridHeaderCtrl This probably doesn't matter much, but use the correct mouse position in this event, expressed in wxGrid coordinate system instead of using screen coordinates. --- include/wx/generic/private/grid.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/wx/generic/private/grid.h b/include/wx/generic/private/grid.h index f2feaa77e8..96755a089c 100644 --- a/include/wx/generic/private/grid.h +++ b/include/wx/generic/private/grid.h @@ -163,12 +163,13 @@ protected: wxGrid *GetOwner() const { return static_cast(GetParent()); } private: - static wxMouseEvent GetDummyMouseEvent() + wxMouseEvent GetDummyMouseEvent() const { // make up a dummy event for the grid event to use -- unfortunately we // can't do anything else here wxMouseEvent e; e.SetState(wxGetMouseState()); + GetOwner()->ScreenToClient(&e.m_x, &e.m_y); return e; }