Launching in fullscreen gives "Funk" sound sometimes
Launching in fullscreen gives "Funk" sound sometimes
- Subject: Launching in fullscreen gives "Funk" sound sometimes
- From: Gabriel Zachmann via Cocoa-dev <email@hidden>
- Date: Wed, 24 Jun 2020 11:23:52 +0200
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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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