Skip to content

Conversation

@dkwingsmt
Copy link
Contributor

@dkwingsmt dkwingsmt commented Jul 13, 2020

Description

This PR documents how system mouse cursors are mapped to platform values on Windows (Win32) and Linux (GTK), officially supporting them.

Almost all native cursors are mapped to as many Flutter cursors as possible.

Related Issues

Tests

I added the following tests:

  • N/A. They're only doc changes

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.

@fluttergithubbot fluttergithubbot added the framework flutter/packages/flutter repository. See also f: labels. label Jul 13, 2020
@fluttergithubbot
Copy link
Contributor

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.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@dkwingsmt dkwingsmt added a: mouse Issues related to using a mouse or mouse support a: desktop Running on desktop labels Jul 14, 2020
/// The cursor names are chosen to reflect the cursors' use cases instead of
/// their shapes, because different platforms might (although not commonly) use
/// different shapes for the same use case.
/// The cursor names are based on the cursors' use cases instead of their shapes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous explanation seemed more complete to me, because it explained why.

/// * Windows: IDC_WAIT
/// * Web: wait
/// * Linux: wait
///
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 also add "macOS: [not available]" (and iOS) or something, so that it's clear that it isn't available on macOS/iOS? Or at least a statement that it isn't supported on systems that aren't listed. What happens if I specify SystemMouseCursor.wait on a system that doesn't support it?

Copy link
Contributor Author

@dkwingsmt dkwingsmt Jul 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the following comment

/// If the platform that the application is running on is not listed for a cursor,
/// using this cursor falls back to [basic].

(Thought I did, thanks for pointing out).

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@fluttergithubbot
Copy link
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite framework_tests-widgets-macos has failed. Please fix the issues identified (or deflake) before re-applying this label.

@dkwingsmt dkwingsmt merged commit 6e0bc30 into flutter:master Jul 15, 2020
@dkwingsmt dkwingsmt deleted the complete-system-cursors-windows-linux branch July 15, 2020 20:40
Pragya007 pushed a commit to Pragya007/flutter that referenced this pull request Aug 11, 2020
…utter#61399)

Add document for mouse cursor mapping on Windows and Linux.
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
…utter#61399)

Add document for mouse cursor mapping on Windows and Linux.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: desktop Running on desktop a: mouse Issues related to using a mouse or mouse support framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants