Fix coordinates of wxSetCursorEvent in wxGTK.

The event coordinates remained in the client coordinates of the window the
initial event had been sent to, even when the event was propagated to its
parent.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2015-02-14 15:04:55 +00:00
parent 14c29db79c
commit e22fcf204e
2 changed files with 12 additions and 3 deletions

View File

@@ -1552,9 +1552,13 @@ static const wxCursor* gs_overrideCursor;
static void SendSetCursorEvent(wxWindowGTK* win, int x, int y)
{
wxSetCursorEvent event(x, y);
wxPoint posClient(x, y);
const wxPoint posScreen = win->ClientToScreen(posClient);
wxWindowGTK* w = win;
do {
for ( ;; )
{
wxSetCursorEvent event(posClient.x, posClient.y);
if (w->GTKProcessEvent(event))
{
gs_overrideCursor = &event.GetCursor();
@@ -1566,8 +1570,12 @@ static void SendSetCursorEvent(wxWindowGTK* win, int x, int y)
// this is how wxMSW works...
if (w->GetCursor().IsOk())
break;
w = w->GetParent();
} while (w);
if ( !w )
break;
posClient = w->ScreenToClient(posScreen);
}
if (gs_needCursorResetMap[win])
win->GTKUpdateCursor();
}