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:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user