[macOS] Add move timer runloop mode to common modes#182295
Conversation
80effef to
dbefefb
Compare
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
I have very limited knowledge in desktop, so can only provide objc related feedback
a599bcc to
1b8fce9
Compare
mattkae
left a comment
There was a problem hiding this comment.
Unfortunate, but ok by me :)
|
from iOS triage: is the PR ready to merge? |
1b8fce9 to
b5ca7fb
Compare
b5ca7fb to
2e37dcc
Compare
2e37dcc to
9f5d98d
Compare
9f5d98d to
98ca9ae
Compare
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
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
…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
…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
Fixes #182294 by adding
_NSMoveTimerRunLoopModeto common run loop modes. This ensures that Flutter messages are processed during sheet animation.This PR avoids referencing
_NSMoveTimerRunLoopModein 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 throughCFRunLoopCopyAllModes.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-assistbot 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.