]> git.saurik.com Git - wxWidgets.git/commitdiff
The position (mouse pos) returned by wxKeyEvent sometimes
authorRobert Roebling <robert@roebling.de>
Sun, 27 Feb 2005 17:47:57 +0000 (17:47 +0000)
committerRobert Roebling <robert@roebling.de>
Sun, 27 Feb 2005 17:47:57 +0000 (17:47 +0000)
    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

src/gtk/window.cpp
src/gtk1/window.cpp

index a55d32a3ad1cecaf558d0d4a0b14b472088ba483..90d84b4683b39edf0b870441961a2d9272697713 100644 (file)
@@ -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 );
index a55d32a3ad1cecaf558d0d4a0b14b472088ba483..90d84b4683b39edf0b870441961a2d9272697713 100644 (file)
@@ -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 );