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

Commit 85516ec

Browse files
authored
[macOS] Remove view ID from public (#41712)
This is a reland of #39958, but only contains the minimal changes that removes all references to viewId from public interfaces, reverting these changes from #39576. Flutter doesn't really support multi-view anyway. These methods currently only works for view 0. We better remove them until we mark multi-view stable. It was a mistake that I decided to add them to public interfaces. For the reason why #39958 failed, I'm pretty sure it's the change to [platform_dispatcher.dart](https://github.com/flutter/engine/pull/39958/files#diff-57d6953e215d0e5dd7260ee60b665c812aa730566ef0b30f7ff1e3d661143585) that mysteriously and unintentionally appeared in the change list. ## 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]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style [testing the engine]: https://github.com/flutter/flutter/wiki/Testing-the-engine [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
1 parent a0906bd commit 85516ec

File tree

4 files changed

+10
-26
lines changed

4 files changed

+10
-26
lines changed

shell/platform/darwin/macos/framework/Headers/FlutterEngine.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@
1717

1818
// TODO: Merge this file with the iOS FlutterEngine.h.
1919

20-
/**
21-
* The view ID for APIs that don't support multi-view.
22-
*
23-
* Some single-view APIs will eventually be replaced by their multi-view
24-
* variant. During the deprecation period, the single-view APIs will coexist with
25-
* and work with the multi-view APIs as if the other views don't exist. For
26-
* backward compatibility, single-view APIs will always operate on the view with
27-
* this ID. Also, the first view assigned to the engine will also have this ID.
28-
*/
29-
extern const uint64_t kFlutterDefaultViewId;
30-
3120
@class FlutterViewController;
3221

3322
/**

shell/platform/darwin/macos/framework/Headers/FlutterPluginRegistrarMacOS.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ FLUTTER_DARWIN_EXPORT
4444
*/
4545
@property(nullable, readonly) NSView* view;
4646

47-
/**
48-
* The `NSView` associated with the given view ID, if any.
49-
*/
50-
- (nullable NSView*)viewForId:(uint64_t)viewId;
51-
5247
/**
5348
* Registers |delegate| to receive handleMethodCall:result: callbacks for the given |channel|.
5449
*/

shell/platform/darwin/macos/framework/Headers/FlutterViewController.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@ FLUTTER_DARWIN_EXPORT
5353
*/
5454
@property(nonatomic, nonnull, readonly) FlutterEngine* engine;
5555

56-
/**
57-
* The identifier for this view controller.
58-
*
59-
* The ID is assigned by FlutterEngine when the view controller is attached.
60-
*
61-
* If the view controller is unattached (see FlutterViewController#attached),
62-
* reading this property throws an assertion.
63-
*/
64-
@property(nonatomic, readonly) uint64_t viewId;
65-
6656
/**
6757
* The style of mouse tracking to use for the view. Defaults to
6858
* FlutterMouseTrackingModeInKeyWindow.

shell/platform/darwin/macos/framework/Source/FlutterViewController_Internal.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@
1313

1414
@interface FlutterViewController () <FlutterKeyboardViewDelegate>
1515

16+
/**
17+
* The identifier for this view controller.
18+
*
19+
* The ID is assigned by FlutterEngine when the view controller is attached.
20+
*
21+
* If the view controller is unattached (see FlutterViewController#attached),
22+
* reading this property throws an assertion.
23+
*/
24+
@property(nonatomic, readonly) uint64_t viewId;
25+
1626
// The FlutterView for this view controller.
1727
@property(nonatomic, readonly, nullable) FlutterView* flutterView;
1828

0 commit comments

Comments
 (0)