Re: Launching in fullscreen gives "Funk" sound sometimes
Re: Launching in fullscreen gives "Funk" sound sometimes
- Subject: Re: Launching in fullscreen gives "Funk" sound sometimes
- From: Graham Cox via Cocoa-dev <email@hidden>
- Date: Thu, 25 Jun 2020 00:17:58 +1000
Set a symbolic breakpoint on NSBeep and see whether it’s your code that’s
calling it.
—Graham
> On 24 Jun 2020, at 7:23 pm, Gabriel Zachmann via Cocoa-dev
> <email@hidden> wrote:
>
> I have an app that should switch to fullscreen automatically,
> if it is launched with a specific flag.
>
> This is my code to switch to fullscreen at startup (in AppDelegate.m):
>
> - (void) applicationWillFinishLaunching: (NSNotification *) notification
> {
> [self.window setFrameAutosaveName: @"de.zach.ArtSaverApp"]; // make
> window "remember" its positions & size; do it before handling "-f"
>
> bool startInFullScreen = NO;
>
> // check flags ...
>
> if ( startInFullScreen )
> [self.window toggleFullScreen: nil];
> }
>
>
> The problem is that , sometimes, the app does not receive keystrokes.
> At least, I get the typical "Funk" sound when typing a key,
> just like what occurs sometimes in other apps, when the focus is somehow out
> of sync.
>
> The problem occurs only sometimes, but I could not find a pattern.
> (Maybe, it's got something to do with timing?)
> Should I put the switch to fullscreen mode somewhere else?
>
>
> I tried to add this in -viewDidLoad in MasterWindowController:
>
> [[[self view] window] makeKeyAndOrderFront: NULL];
>
> But it didn't help.
>
> Of course, when the app launches normally, and does not call toggleFullScreen,
> then everything is fine with the keyboard focus.
>
>
> Any insights or ideas will be greatly appreciated.
>
> Best regards, Gabriel
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden