NSApplication modal sheet panel not dismissable when relative window is nil

Originator:jalkut
Number:rdar://21981633 Date Originated:24-Jul-2015 09:47 AM
Status:Closed Resolved:Behaves as Intended
Product:OS X Product Version:10.11
Classification:Serious Bug Reproducible:Always
 
Summary:
Starting in 10.11, apps that (ab)use -[NSApplication beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:]  by passing a nil window value have their panels displayed, but they become undismissable, presumably because of some change in the way the modal panel loop operates in this condition.

I've observed this "in the wild" with two shipping apps including VoodooPad and Apple's own Safari shipping with 10.11 (see Radar #21981467).

Even though the method is deprecated, and the parameter is apparently not intended to ever be nil, it has behaved historically as a standalone modal panel presenter when the window parameter is nil. To avoid a lot of "hung" apps that must be force-quit because of this issue, the existing behavior should be preserved until this method is outright removed from the frameworks.

Steps to Reproduce:
1. Open the attached sample project.
2. Build and run.
3. Click the button to display the panel.
4. Click either cancel or save buttons on the panel.


Expected Results:
The panel should be dismissed.

Actual Results:
The panel remains visible and can't be dismissed.



Version:
10.11 Beta (15A226f)

Notes:


Configuration:


Attachments:
'ModalMishaps.zip' was successfully uploaded.

Apple closed the bug on 7/28/2015: Behaves as Intended.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!