Skip to content

Commit

Permalink
Fix the "floating" location of the popover on initial load.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Feb 21, 2024
1 parent 385ae8f commit eaacd83
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/cordova/apple/xcode/macos/Outline/Classes/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,16 @@ - (void)applicationDidFinishLaunching:(NSNotification*)aNotification {
}
}];
} else {
[self showPopover];
// The rendering of the popover is relative to the app's status item in the status bar.
// Even though we've already created the status bar above, the popover is being created
// before the status item has been rendered in the UI. This causes the initial popover
// load to be "floating" and ends up aligned at the bottom of the screen. For this initial
// load we add a small artificial delay to prevent that from happening.
double delayInSeconds = 0.5;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
[self showPopover];
});
}
[self setAppLauncherEnabled:true]; // Enable app launcher to start on boot.
}
Expand Down

0 comments on commit eaacd83

Please sign in to comment.