Closed wxtrac closed 5 years ago
CarbonSetCursor.patch
(7.7 KiB)CarbonSetCursor2.patch
(9.1 KiB)The difference between the first and second patches is in wxWindowMac::MacSetupCursor.
Before the second patch (i.e. before patch 1 or with patch 1):
After the second patch:
Before the second patch: during wxSplitterWindow sash dragging, the custom cursor (the sash resizing cursor) can be lost when the drag leaves the range of the wxSplitterWindow.
After the second patch: the custom cursor (the sash resizing cursor) is kept while the button remains down (even if the cursor leaves the wxSplitterWindow).
If the first patch is applied I can re-diff and submit a new patch against the new trunk.
Part of my reasoning behind the change from patch 1 to patch 2 was the following in the docs: "A wxSetCursorEvent is generated from wxWindow when the mouse cursor is about to be set as a result of mouse motion." This seems to weakly imply that wxSetCursorEvent isn't used when the mouse is captured. (Which also seems to be what wxSplitterWindow assumes. And, as an aside: the comment "// this is currently called (and needed) under MSW only..." in src/generic/splitter.cpp doesn't seem to be spot-on as wxSplitterWindow::OnSetCursor() is called on wxOSX.)
Should the wxSetCursorEvent docs be updated to clarify the event's relationship to captured mice?
Obviously, I didn't mean to change the status to "closed". This sort of thing would happen less often if the Action wouldn't default to "close/resolve ticket". (Why trac does that I don't know... but I seem to have trouble remembering every time to make sure it doesn't implicitly close the ticket as having Action default to "close/resolve ticket" makes no sense to me.)
jatupper, Does those changes still make sense for Cocoa?
Carbon version is not supported anymore - all development of wxWidgets is moved to Cocoa.
Since there is no response to comment #5, I'm closing the ticket.
Please re-open if there is any issues that can be improved with the current Cocoa implementation.
Issue migrated from trac ticket # 11519
component: wxOSX | priority: normal | resolution: outdated
2009-12-06 03:31:43: jatupper (Jeff Tupper) created the issue
Here is a patch that improves wxOSX/Carbon's handling of custom cursors. Some comments regarding the patch follow.
wxWindowMac::MacSetupCursor: I've removed
as this end-of-loop case (of the child-to-parent looping) is now in the looping procedure itself (wxMacUpdateCursor).
wxMacControl::SetCursor: the current version (from trunk) compares mouseWin with tlwwx; older versions compared mouseWin with the pre-peer of *this. With my application, the current logic prevents SetCursor from installing cursors. (When I try setting the cursor in my wxWindow-derived object, wxMacControl::SetCursor ends up comparing that object (mouseWin) with its enclosing wxFrame (tlwwx) and then doesn't install the cursor.)
src/osx/carbon/nonownedwnd.cpp: what is the point of the following snippet? The patch brackets it out. (No loss of capture message is sent; the docs don't mention mouse-up as leading to an implicit loss of capture.)
I guess that's about it. If there are specific questions, I can try to answer them. Custom cursor handling doesn't seem to be covered (much?) in the samples. My applications work better post-patch.