From: Robert Roebling Date: Sun, 27 Feb 2005 17:47:57 +0000 (+0000) Subject: The position (mouse pos) returned by wxKeyEvent sometimes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c958d025fa18c6446eb22e06b745317c48e19c53 The position (mouse pos) returned by wxKeyEvent sometimes was wrong, as it reported the position relative to the TLW (this is what a bug report claims, in any case). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index a55d32a3ad..90d84b4683 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1000,6 +1000,8 @@ static void wxFillOtherKeyEventFields(wxKeyEvent& event, #if wxUSE_UNICODE event.m_uniChar = gdk_keyval_to_unicode(gdk_event->keyval); #endif + wxGetMousePosition( &x, &y ); + win->ScreenToClient( &x, &y ); event.m_x = x; event.m_y = y; event.SetEventObject( win ); diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index a55d32a3ad..90d84b4683 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -1000,6 +1000,8 @@ static void wxFillOtherKeyEventFields(wxKeyEvent& event, #if wxUSE_UNICODE event.m_uniChar = gdk_keyval_to_unicode(gdk_event->keyval); #endif + wxGetMousePosition( &x, &y ); + win->ScreenToClient( &x, &y ); event.m_x = x; event.m_y = y; event.SetEventObject( win );