Skip to content

Commit

Permalink
Merge pull request #221 from vanstinator/fix/ignore-background-state
Browse files Browse the repository at this point in the history
fix: avoid computing incorrect ios screen sizes when the app is backgrounded
  • Loading branch information
jpudysz authored Jun 27, 2024
2 parents c069ad6 + 3f9b0c0 commit 2d5d254
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ios/platform/Platform_iOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ - (void)onContentSizeCategoryChange:(NSNotification *)notification {

- (void)onWindowChange:(NSNotification *)notification {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
UIApplicationState appState = [UIApplication sharedApplication].applicationState;

if (appState == UIApplicationStateBackground) {
return;
}

Screen screen = [self getScreenDimensions];
Insets insets = [self getInsets];
Dimensions statusBar = [self getStatusBarDimensions];
Expand Down

0 comments on commit 2d5d254

Please sign in to comment.