Fix for resetting the cursor back to default when not over a gripper. Solves an inconsistency between macOS and Windows
issue #25811
https://github.com/wxWidgets/wxWidgets/pull/25813
(1 file)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
I've created #25814 which would be a better fix, if it works for you — I didn't have time to test it, could you please do it? TIA!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Great! Will give it a try tomorrow and let you know
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Tried the patch but the behavior seems unchanged. I plan to do some more test, but I build wx offline, so I can't easily inspect the issue in a debugger. Will follow up.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Just as a test, I put a assert(false);
at the top of the new wxWindowMac::WXUpdateCursor() and it seems like it never gets triggered when the cursor is changed by aui on macOS.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Oh, I had somehow assumed that the cursor was set via SetCursor()
but this is not the case here, it's set implicitly by processing wxEVT_SET_CURSOR
and the code for handling this is in a different place.
Moreover, I'm much less sure about what returning a null cursor from this event handler supposed to mean. It seems that doing this is actually illegal, at least this is what the documentation for wxSetCursorEvent::HasCursor()
implies. So maybe the correct fix is actually this:
diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index 0b368b7110..148495a1cb 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -3979,6 +3979,9 @@ void wxAuiManager::OnFindManager(wxAuiManagerEvent& evt) void wxAuiManager::OnSetCursor(wxSetCursorEvent& event) { + // Don't set any cursor by default. + event.Skip(); + // determine cursor wxAuiDockUIPart* part = HitTest(event.GetX(), event.GetY()); wxCursor cursor; @@ -4010,7 +4013,13 @@ void wxAuiManager::OnSetCursor(wxSetCursorEvent& event) } } - event.SetCursor(cursor); + if ( cursor.IsOk() ) + { + event.SetCursor(cursor); + + // Undo Skip() done above. + event.Skip(false); + } }
Does this work for you?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
I tried this change and this does indeed fix the issue I was seeing on macOS
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Closed #25813.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Thanks for testing, I'm closing this one then and will push this change to fix the bug soon.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.