Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[macOS] Fix mouse cursor being replaced by AppKit #36283

Merged
merged 2 commits into from
Oct 20, 2022

Conversation

knopp
Copy link
Member

@knopp knopp commented Sep 20, 2022

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

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

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.

Copy link
Contributor

@justinmc justinmc left a 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
}
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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)

@chinmaygarde
Copy link
Member

Ping @dkwingsmt on a review.

Copy link
Contributor

@dkwingsmt dkwingsmt left a 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

@zanderso
Copy link
Member

From PR review triage: @knopp is this ready to land?

@chinmaygarde
Copy link
Member

Ping.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App needs tests platform-macos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[macOS] Attaching/Detaching to TextInputClient changes mouse cursor
5 participants