This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed
shell/platform/darwin/macos/framework/Source Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ - (BOOL)runWithEntrypoint:(NSString*)entrypoint {
289289
290290 [self sendUserLocales ];
291291 [self updateDisplayConfig ];
292- [ self .viewController.flutterView start ] ;
292+ self.viewController .flutterView . synchronousResizing = YES ;
293293 return YES ;
294294}
295295
@@ -301,7 +301,7 @@ - (void)setViewController:(FlutterViewController*)controller {
301301 _resourceContext = nil ;
302302 }
303303 if (_engine) {
304- [ self .viewController.flutterView start ] ;
304+ self.viewController .flutterView . synchronousResizing = YES ;
305305 }
306306}
307307
@@ -353,7 +353,7 @@ - (void)updateDisplayConfig {
353353 CVDisplayLinkRelease (displayLinkRef);
354354}
355355
356- // Must be driven by FlutterView (i.e. [FlutterView start])
356+ // Called by [FlutterViewController viewDidReshape]
357357- (void )updateWindowMetrics {
358358 if (!_engine) {
359359 return ;
Original file line number Diff line number Diff line change 2121@interface FlutterView : NSView
2222
2323@property (readwrite , nonatomic , nonnull ) NSOpenGLContext * openGLContext;
24+ @property (readwrite , nonatomic ) BOOL synchronousResizing;
2425
2526- (nullable instancetype )initWithFrame : (NSRect )frame
2627 shareContext : (nonnull NSOpenGLContext *)shareContext
3738- (nullable instancetype )initWithCoder : (nonnull NSCoder *)coder NS_UNAVAILABLE;
3839- (nonnull instancetype )init NS_UNAVAILABLE;
3940
40- - (void )start ;
4141- (void )present ;
4242- (int )getFrameBufferIdForSize : (CGSize)size ;
4343
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ @interface FlutterView () <FlutterResizeSynchronizerDelegate> {
1313 __weak id <FlutterViewReshapeListener> _reshapeListener;
1414 FlutterResizeSynchronizer* resizeSynchronizer;
1515 FlutterSurfaceManager* surfaceManager;
16- BOOL active;
1716 CALayer * contentLayer;
1817}
1918
@@ -80,18 +79,15 @@ - (void)present {
8079 [resizeSynchronizer requestCommit ];
8180}
8281
83- - (void )start {
84- active = YES ;
85- [self reshaped ];
86- }
87-
8882- (void )reshaped {
89- if (active ) {
83+ if (self. synchronousResizing ) {
9084 CGSize scaledSize = [self convertSizeToBacking: self .bounds.size];
9185 [resizeSynchronizer beginResize: scaledSize
9286 notify: ^{
9387 [_reshapeListener viewDidReshape: self ];
9488 }];
89+ } else {
90+ [_reshapeListener viewDidReshape: self ];
9591 }
9692}
9793
You can’t perform that action at this time.
0 commit comments