Open document panel always on top - Mountain Lion
Open document panel always on top - Mountain Lion
- Subject: Open document panel always on top - Mountain Lion
- From: Matthew LeRoy <email@hidden>
- Date: Thu, 09 Oct 2014 14:21:48 +0000
- Thread-topic: Open document panel always on top - Mountain Lion
Good morning,
My document-based application can potentially display an app-modal dialog via [NSApp runModalForWindow:] from within my override of [NSDocument readFromURL:ofType:error:], in order to prompt the user for the password to open a document. For the most part, this works just fine.
The trouble I’m running into is that on Mountain Lion my password dialog is hidden behind the Open dialog, which remains open but non-responsive while my document-reading code executes (i.e. It doesn’t response to mouse clicks, can’t drag/move it out of the way to reveal the password dialog, etc). The password dialog does become key, even though I can’t see it; I can press ‘Esc’ to close it which cancels the opening process, or type the password blindly and press ‘Enter’ and, assuming I got the password right, things will proceed normally. If I switch to another application while the hidden password dialog is waiting for user input, the still-open Open dialog from my application remains on top, even on top of windows from other active applications. The Open dialog is shown via the built-in document architecture methods — I haven’t done anything to specialize it other than to modify the enabled file types by overriding [NSDocumentController beginOpenPanel:forTypes:completionHandler:] and [NSDocumentController runModalOpenPanel:forTypes:].
On Mavericks, the Open dialog closes prior to my readFromURL: code executing, and so the password dialog is visible and everything is fine.
Any thoughts? I’ve tried calling [NSWindow setLevel:] with NSModalPanelWindowLevel and NSStatusWindowLevel on the password dialog window prior to calling [NSApp runModalForWindow:] with no luck.
Thanks!
_______________________________________________
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