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:
@@ -589,6 +589,7 @@ wxGTK:
|
|||||||
- Fix infinite sizing loop with GTK3 when using wxScrolled with a non-default
|
- Fix infinite sizing loop with GTK3 when using wxScrolled with a non-default
|
||||||
target window.
|
target window.
|
||||||
- Fix crashes in wxGTK3 when running with non-X11 backend (Marco Trevisan).
|
- Fix crashes in wxGTK3 when running with non-X11 backend (Marco Trevisan).
|
||||||
|
- Fix coordinates of wxSetCursorEvent propagated to parent windows.
|
||||||
|
|
||||||
wxMSW:
|
wxMSW:
|
||||||
|
|
||||||
|
@@ -1552,9 +1552,13 @@ static const wxCursor* gs_overrideCursor;
|
|||||||
|
|
||||||
static void SendSetCursorEvent(wxWindowGTK* win, int x, int y)
|
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;
|
wxWindowGTK* w = win;
|
||||||
do {
|
for ( ;; )
|
||||||
|
{
|
||||||
|
wxSetCursorEvent event(posClient.x, posClient.y);
|
||||||
if (w->GTKProcessEvent(event))
|
if (w->GTKProcessEvent(event))
|
||||||
{
|
{
|
||||||
gs_overrideCursor = &event.GetCursor();
|
gs_overrideCursor = &event.GetCursor();
|
||||||
@@ -1566,8 +1570,12 @@ static void SendSetCursorEvent(wxWindowGTK* win, int x, int y)
|
|||||||
// this is how wxMSW works...
|
// this is how wxMSW works...
|
||||||
if (w->GetCursor().IsOk())
|
if (w->GetCursor().IsOk())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
w = w->GetParent();
|
w = w->GetParent();
|
||||||
} while (w);
|
if ( !w )
|
||||||
|
break;
|
||||||
|
posClient = w->ScreenToClient(posScreen);
|
||||||
|
}
|
||||||
if (gs_needCursorResetMap[win])
|
if (gs_needCursorResetMap[win])
|
||||||
win->GTKUpdateCursor();
|
win->GTKUpdateCursor();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user