Fixed problems with popover

This commit is contained in:
Andrea Alberti 2025-09-28 22:51:25 +02:00
parent 25e0b43518
commit 7a6ff17a59
2 changed files with 14 additions and 4 deletions

View File

@ -580,7 +580,16 @@ static NSTimeInterval updateSystemVolumeInterval=0.1f;
systemAudio = [[SystemApplication alloc] init];
[self showInStatusBarWithCompletion:nil]; // Install icon into the menu bar
// Install icon into the menu bar
[self showInStatusBarWithCompletion:^{
// This code will only run AFTER the icon has been created and is visible.
// Initiate hiding it
if([self hideFromStatusBar]) {
NSLog(@"Started hiding from status bar");
[self setHideFromStatusBar:YES];
}
}];
// NSString* iTunesVersion = [[NSString alloc] initWithString:[iTunes version]];
// NSString* spotifyVersion = [[NSString alloc] initWithString:[spotify version]];
@ -1225,7 +1234,7 @@ static NSTimeInterval updateSystemVolumeInterval=0.1f;
{
if ([_hideFromStatusBarHintPopover isShown]) return;
NSLog(@"Will show popover");
// NSLog(@"Will show popover");
if (! _hideFromStatusBarHintPopover)
{
@ -1335,11 +1344,12 @@ static NSTimeInterval updateSystemVolumeInterval=0.1f;
- (void)menuDidClose:(NSMenu *)menu
{
menuIsVisible=false;
if([self hideFromStatusBar])
if([[self statusBar] isVisible] && [self hideFromStatusBar])
{
[self showHideFromStatusBarHintPopover];
}
// Remove timer used to update volume bar status in the menu bar
if(updateSystemVolumeTimer)
{
[updateSystemVolumeTimer invalidate];

View File

@ -29,7 +29,7 @@
},
{
"name": "Run App for debug",
"shell_cmd": "open '${project_path}/build/Debug/Volume Control.app'",
"shell_cmd": "source ./build_config.env && open \"\\${CONFIGURATION_BUILD_DIR}/Volume Control.app\"",
"working_dir": "${project_path}"
},
{