This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree 3 files changed +7
-11
lines changed
shell/platform/darwin/macos/framework/Source
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 {
289
289
290
290
[self sendUserLocales ];
291
291
[self updateDisplayConfig ];
292
- [ self .viewController.flutterView start ] ;
292
+ self.viewController .flutterView . synchronousResizing = YES ;
293
293
return YES ;
294
294
}
295
295
@@ -301,7 +301,7 @@ - (void)setViewController:(FlutterViewController*)controller {
301
301
_resourceContext = nil ;
302
302
}
303
303
if (_engine) {
304
- [ self .viewController.flutterView start ] ;
304
+ self.viewController .flutterView . synchronousResizing = YES ;
305
305
}
306
306
}
307
307
@@ -353,7 +353,7 @@ - (void)updateDisplayConfig {
353
353
CVDisplayLinkRelease (displayLinkRef);
354
354
}
355
355
356
- // Must be driven by FlutterView (i.e. [FlutterView start])
356
+ // Called by [FlutterViewController viewDidReshape]
357
357
- (void )updateWindowMetrics {
358
358
if (!_engine) {
359
359
return ;
Original file line number Diff line number Diff line change 21
21
@interface FlutterView : NSView
22
22
23
23
@property (readwrite , nonatomic , nonnull ) NSOpenGLContext * openGLContext;
24
+ @property (readwrite , nonatomic ) BOOL synchronousResizing;
24
25
25
26
- (nullable instancetype )initWithFrame : (NSRect )frame
26
27
shareContext : (nonnull NSOpenGLContext *)shareContext
37
38
- (nullable instancetype )initWithCoder : (nonnull NSCoder *)coder NS_UNAVAILABLE;
38
39
- (nonnull instancetype )init NS_UNAVAILABLE;
39
40
40
- - (void )start ;
41
41
- (void )present ;
42
42
- (int )getFrameBufferIdForSize : (CGSize )size ;
43
43
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ @interface FlutterView () <FlutterResizeSynchronizerDelegate> {
13
13
__weak id <FlutterViewReshapeListener> _reshapeListener;
14
14
FlutterResizeSynchronizer* resizeSynchronizer;
15
15
FlutterSurfaceManager* surfaceManager;
16
- BOOL active;
17
16
CALayer * contentLayer;
18
17
}
19
18
@@ -80,18 +79,15 @@ - (void)present {
80
79
[resizeSynchronizer requestCommit ];
81
80
}
82
81
83
- - (void )start {
84
- active = YES ;
85
- [self reshaped ];
86
- }
87
-
88
82
- (void )reshaped {
89
- if (active ) {
83
+ if (self. synchronousResizing ) {
90
84
CGSize scaledSize = [self convertSizeToBacking: self .bounds.size];
91
85
[resizeSynchronizer beginResize: scaledSize
92
86
notify: ^{
93
87
[_reshapeListener viewDidReshape: self ];
94
88
}];
89
+ } else {
90
+ [_reshapeListener viewDidReshape: self ];
95
91
}
96
92
}
97
93
You can’t perform that action at this time.
0 commit comments