Pre-Login Agent NSPanel in to focus

Hello,

I've been playing around with the PreLoginAgents code sample project and one issue I can not seem to figure out is how to bring the NSPanel in to focus. It's visible but the title bar is greyed out. I've tried changing the window level and tried using "makeKeyAndOrderFront" and nothing seems to work.

What am I missing here?

Thanks!

Accepted Reply

Getting windows to show up correctly in the pre-login environment is quite tricky (pre-login agents are actually easy compared to, say, GUI authorisation plug-ins). The only immediate suggestion I have is to call:

[NSApp activateIgnoringOtherApps:YES];

after your window is up. If that doesn’t work out you should open a DTS tech support incident and we can take an in-depth look at this.

Alternatively, you could structure your window so that it doesn’t need to be activated. In many ways that make sense from a UI perspective, in that you don’t want to take keyboard focus away from the standard login UI.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

Getting windows to show up correctly in the pre-login environment is quite tricky (pre-login agents are actually easy compared to, say, GUI authorisation plug-ins). The only immediate suggestion I have is to call:

[NSApp activateIgnoringOtherApps:YES];

after your window is up. If that doesn’t work out you should open a DTS tech support incident and we can take an in-depth look at this.

Alternatively, you could structure your window so that it doesn’t need to be activated. In many ways that make sense from a UI perspective, in that you don’t want to take keyboard focus away from the standard login UI.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Quinn, thank you. I got it working with your suggestion. I did have to add a short delay right before calling it. Since my app was launching before the loginwindow, so I had to wait for the loginwindow to finish launching.


thanks again!