On Jun 24, 2020, at 5:23 AM, Gabriel Zachmann via Cocoa-dev 
<cocoa-dev@lists.apple.com> wrote:
> I tried to add this in -viewDidLoad in MasterWindowController:
> 
>    [[[self view] window] makeKeyAndOrderFront: NULL];

Some questions that may or may not help:

- Are you sure the above line of code is being called?  (I would check with a 
NSLog rather than a breakpoint.  Using a breakpoint can cause the active 
application to change, which you may not want.  You want to see what's 
happening when your app launches without *affecting* what's happening.)
- Did you mean -windowDidLoad rather than -viewDidLoad?
- What is the application *supposed* to do when you type keystrokes?
- I saw the thread earlier where you moved some logic into 
applicationWillFinishLaunching:.  What if you add back 
applicationDidFinishLaunching: and move just the full-screen toggling code 
there (and keep the rest in applicationWillFinishLaunching:)?
- Are you sure your application is the active application when you're typing 
those keystrokes?  You can check this by adding applicationDidBecomeActive: and 
applicationDidResignActive: methods to the application delegate, and having 
them call NSLog.  I'm not sure offhand if makeKeyAndOrderFront: makes the 
application active.
- Does your window have an initialFirstResponder?  Not sure this would make a 
difference in your case, but might in some circumstances. The 
initialFirstResponder can be set in Interface Builder.

--Andy

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to