Skip to content

[macOS] Add move timer runloop mode to common modes#182295

Merged
knopp merged 3 commits into
flutter:masterfrom
knopp:fix_move_run_loop_mode
Apr 10, 2026
Merged

[macOS] Add move timer runloop mode to common modes#182295
knopp merged 3 commits into
flutter:masterfrom
knopp:fix_move_run_loop_mode

Conversation

@knopp

@knopp knopp commented Feb 12, 2026

Copy link
Copy Markdown
Member

Fixes #182294 by adding _NSMoveTimerRunLoopMode to common run loop modes. This ensures that Flutter messages are processed during sheet animation.

This PR avoids referencing _NSMoveTimerRunLoopMode in code directly to avoid the possibility of being flagged an SPI. Instead it runs a very brief (~10ms) hidden animation and then gets the run loop mode through CFRunLoopCopyAllModes.

Pre-launch Checklist

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

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. a: desktop Running on desktop platform-macos labels Feb 12, 2026
@knopp knopp force-pushed the fix_move_run_loop_mode branch from 80effef to dbefefb Compare February 12, 2026 14:47

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a clever workaround to fix an issue with Flutter UI freezing during sheet animations on macOS by adding a private run loop mode to the common modes. The approach avoids using private APIs directly by briefly triggering a hidden window animation.

My review found a memory leak in the implementation due to an incorrect Core Foundation to ARC bridge cast. I've suggested a fix for this. Additionally, the new functionality appears to be disabled via a commented-out line of code, and I've asked for clarification on this point. The added test case correctly verifies the intended behavior of the new method.

@hellohuanlin hellohuanlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have very limited knowledge in desktop, so can only provide objc related feedback

@knopp knopp force-pushed the fix_move_run_loop_mode branch from a599bcc to 1b8fce9 Compare February 16, 2026 12:18
mattkae
mattkae previously approved these changes Feb 18, 2026

@mattkae mattkae left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unfortunate, but ok by me :)

@LongCatIsLooong

Copy link
Copy Markdown
Contributor

from iOS triage: is the PR ready to merge?

@knopp knopp force-pushed the fix_move_run_loop_mode branch from 1b8fce9 to b5ca7fb Compare March 17, 2026 12:39
@knopp knopp requested a review from a team as a code owner March 17, 2026 12:39
@github-actions github-actions Bot added the team-macos Owned by the macOS platform team label Mar 17, 2026
@knopp knopp force-pushed the fix_move_run_loop_mode branch from b5ca7fb to 2e37dcc Compare March 18, 2026 14:57
@knopp knopp added the CICD Run CI/CD label Apr 2, 2026
@knopp knopp force-pushed the fix_move_run_loop_mode branch from 2e37dcc to 9f5d98d Compare April 8, 2026 19:21
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 8, 2026
@knopp knopp force-pushed the fix_move_run_loop_mode branch from 9f5d98d to 98ca9ae Compare April 10, 2026 16:13
@knopp knopp added the CICD Run CI/CD label Apr 10, 2026
@knopp knopp added this pull request to the merge queue Apr 10, 2026
Merged via the queue into flutter:master with commit 5ce7051 Apr 10, 2026
192 of 194 checks passed
@knopp knopp deleted the fix_move_run_loop_mode branch April 10, 2026 19:39
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 11, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 11, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 11, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 12, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 12, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 12, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 13, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Apr 13, 2026
flutter/flutter@bf18e39...2fa45e0

2026-04-13 sigurdm@google.com Test that the locked version of dependencies of sdk packages equal the lower bound (flutter/flutter#183395)
2026-04-13 engine-flutter-autoroll@skia.org Roll Skia from 8d35796258a2 to 55ddd6bb8be5 (1 revision) (flutter/flutter#184952)
2026-04-12 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from tEm4sdcM6twjxQ0w6... to K_2AkZL3Drs6cGE1q... (flutter/flutter#184930)
2026-04-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 77324e51833a to ef28089d6533 (1 revision) (flutter/flutter#184929)
2026-04-12 engine-flutter-autoroll@skia.org Roll Skia from 6942f5774d65 to 8d35796258a2 (2 revisions) (flutter/flutter#184924)
2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 8fdbf58b58bd to 77324e51833a (1 revision) (flutter/flutter#184921)
2026-04-11 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from lZcRfPoCLnDttrf9P... to tEm4sdcM6twjxQ0w6... (flutter/flutter#184917)
2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 7128b5b5142c to 8fdbf58b58bd (1 revision) (flutter/flutter#184906)
2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from 8cbf3db1a0db to 6942f5774d65 (1 revision) (flutter/flutter#184911)
2026-04-11 rmolivares@renzo-olivares.dev `SelectableRegion` can dismiss context menu with keyboard shortcuts (flutter/flutter#184788)
2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from a8128c7adc49 to 8cbf3db1a0db (1 revision) (flutter/flutter#184904)
2026-04-10 engine-flutter-autoroll@skia.org Roll Dart SDK from e715805ddbd3 to 7128b5b5142c (3 revisions) (flutter/flutter#184896)
2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 7c8b85349a9a to a8128c7adc49 (2 revisions) (flutter/flutter#184899)
2026-04-10 mdebbar@google.com [web] Refactor LazyPath and separate immutable paths from path builders (flutter/flutter#177686)
2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 25b01e5f4ea0 to 7c8b85349a9a (13 revisions) (flutter/flutter#184887)
2026-04-10 mahimasharma0309@gmail.com Reduce boilerplate in FlutterPlatformViewsTest.mm (flutter/flutter#184555)
2026-04-10 matej.knopp@gmail.com [macOS] Add move timer runloop mode to common modes (flutter/flutter#182295)
2026-04-10 engine-flutter-autoroll@skia.org Roll Packages from 1aa892c to c2e3d1f (5 revisions) (flutter/flutter#184886)
2026-04-10 matej.knopp@gmail.com Win32: Prevent mouse leave on WM_SYSKEYUP. (flutter/flutter#184835)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
mbcorona pushed a commit to mbcorona/flutter that referenced this pull request Apr 15, 2026
Fixes flutter#182294 by adding
`_NSMoveTimerRunLoopMode` to common run loop modes. This ensures that
Flutter messages are processed during sheet animation.

This PR avoids referencing `_NSMoveTimerRunLoopMode` in code directly to
avoid the possibility of being flagged an SPI. Instead it runs a very
brief (~10ms) hidden animation and then gets the run loop mode through
`CFRunLoopCopyAllModes`.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

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

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
@stuartmorgan-g stuartmorgan-g added platform-macos Building on or for macOS specifically and removed platform-macos labels Apr 16, 2026
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…r#11497)

flutter/flutter@bf18e39...2fa45e0

2026-04-13 sigurdm@google.com Test that the locked version of dependencies of sdk packages equal the lower bound (flutter/flutter#183395)
2026-04-13 engine-flutter-autoroll@skia.org Roll Skia from 8d35796258a2 to 55ddd6bb8be5 (1 revision) (flutter/flutter#184952)
2026-04-12 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from tEm4sdcM6twjxQ0w6... to K_2AkZL3Drs6cGE1q... (flutter/flutter#184930)
2026-04-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 77324e51833a to ef28089d6533 (1 revision) (flutter/flutter#184929)
2026-04-12 engine-flutter-autoroll@skia.org Roll Skia from 6942f5774d65 to 8d35796258a2 (2 revisions) (flutter/flutter#184924)
2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 8fdbf58b58bd to 77324e51833a (1 revision) (flutter/flutter#184921)
2026-04-11 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from lZcRfPoCLnDttrf9P... to tEm4sdcM6twjxQ0w6... (flutter/flutter#184917)
2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 7128b5b5142c to 8fdbf58b58bd (1 revision) (flutter/flutter#184906)
2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from 8cbf3db1a0db to 6942f5774d65 (1 revision) (flutter/flutter#184911)
2026-04-11 rmolivares@renzo-olivares.dev `SelectableRegion` can dismiss context menu with keyboard shortcuts (flutter/flutter#184788)
2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from a8128c7adc49 to 8cbf3db1a0db (1 revision) (flutter/flutter#184904)
2026-04-10 engine-flutter-autoroll@skia.org Roll Dart SDK from e715805ddbd3 to 7128b5b5142c (3 revisions) (flutter/flutter#184896)
2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 7c8b85349a9a to a8128c7adc49 (2 revisions) (flutter/flutter#184899)
2026-04-10 mdebbar@google.com [web] Refactor LazyPath and separate immutable paths from path builders (flutter/flutter#177686)
2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 25b01e5f4ea0 to 7c8b85349a9a (13 revisions) (flutter/flutter#184887)
2026-04-10 mahimasharma0309@gmail.com Reduce boilerplate in FlutterPlatformViewsTest.mm (flutter/flutter#184555)
2026-04-10 matej.knopp@gmail.com [macOS] Add move timer runloop mode to common modes (flutter/flutter#182295)
2026-04-10 engine-flutter-autoroll@skia.org Roll Packages from 1aa892c to c2e3d1f (5 revisions) (flutter/flutter#184886)
2026-04-10 matej.knopp@gmail.com Win32: Prevent mouse leave on WM_SYSKEYUP. (flutter/flutter#184835)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Istiak-Ahmed78 pushed a commit to Istiak-Ahmed78/packages that referenced this pull request Jun 19, 2026
…r#11497)

flutter/flutter@bf18e39...2fa45e0

2026-04-13 sigurdm@google.com Test that the locked version of dependencies of sdk packages equal the lower bound (flutter/flutter#183395)
2026-04-13 engine-flutter-autoroll@skia.org Roll Skia from 8d35796258a2 to 55ddd6bb8be5 (1 revision) (flutter/flutter#184952)
2026-04-12 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from tEm4sdcM6twjxQ0w6... to K_2AkZL3Drs6cGE1q... (flutter/flutter#184930)
2026-04-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 77324e51833a to ef28089d6533 (1 revision) (flutter/flutter#184929)
2026-04-12 engine-flutter-autoroll@skia.org Roll Skia from 6942f5774d65 to 8d35796258a2 (2 revisions) (flutter/flutter#184924)
2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 8fdbf58b58bd to 77324e51833a (1 revision) (flutter/flutter#184921)
2026-04-11 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from lZcRfPoCLnDttrf9P... to tEm4sdcM6twjxQ0w6... (flutter/flutter#184917)
2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 7128b5b5142c to 8fdbf58b58bd (1 revision) (flutter/flutter#184906)
2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from 8cbf3db1a0db to 6942f5774d65 (1 revision) (flutter/flutter#184911)
2026-04-11 rmolivares@renzo-olivares.dev `SelectableRegion` can dismiss context menu with keyboard shortcuts (flutter/flutter#184788)
2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from a8128c7adc49 to 8cbf3db1a0db (1 revision) (flutter/flutter#184904)
2026-04-10 engine-flutter-autoroll@skia.org Roll Dart SDK from e715805ddbd3 to 7128b5b5142c (3 revisions) (flutter/flutter#184896)
2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 7c8b85349a9a to a8128c7adc49 (2 revisions) (flutter/flutter#184899)
2026-04-10 mdebbar@google.com [web] Refactor LazyPath and separate immutable paths from path builders (flutter/flutter#177686)
2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 25b01e5f4ea0 to 7c8b85349a9a (13 revisions) (flutter/flutter#184887)
2026-04-10 mahimasharma0309@gmail.com Reduce boilerplate in FlutterPlatformViewsTest.mm (flutter/flutter#184555)
2026-04-10 matej.knopp@gmail.com [macOS] Add move timer runloop mode to common modes (flutter/flutter#182295)
2026-04-10 engine-flutter-autoroll@skia.org Roll Packages from 1aa892c to c2e3d1f (5 revisions) (flutter/flutter#184886)
2026-04-10 matej.knopp@gmail.com Win32: Prevent mouse leave on WM_SYSKEYUP. (flutter/flutter#184835)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-macos Building on or for macOS specifically team-macos Owned by the macOS platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[macOS] Modal dialog (sheet) appears black during animation

5 participants