-
Notifications
You must be signed in to change notification settings - Fork 6k
[macOS] Fix mouse cursor being replaced by AppKit #36283
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems ok to me, it looks like the tests pass. Someone who has more experience here (maybe @dkwingsmt?) should definitely also review though.
// instead. This would replace the cursor set by FlutterMouseCursorPlugin. | ||
// Empty cursorUpdate: implementation prevents this behavior. | ||
// https://github.com/flutter/flutter/issues/111425 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way to write a test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a tricky one. We could test if FlutterView responds to the selector. Other than that - well, it gets complicated:
IIRC the method is called when CATransaction is committed. I had little luck getting some calls like this invoked by AppKit in headless environment (when the window is not actually shown). On top of that, macOS embedder tests currently crash when the tests span multiple run loop turns, because of scheduled AppKit callbacks for views that don't exist anymore (I think FlutterTextInputPlugin is one of them). I think there's an issue created for this already but I can't find it right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try asking @Hixie for a test exemption on Discord? (see bot comment above)
Ping @dkwingsmt on a review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for a nit
Co-authored-by: Tong Mu <[email protected]>
From PR review triage: @knopp is this ready to land? |
Ping. |
Fixes flutter/flutter#111425
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.