cocoanswindownspreferencepane

PrefPane in 10.15 will not reopen external windows


My Pref Pane opens a window for each display similar to how the Displays PrefPane works. When I first launch, the OS calls my mainViewDidLoad where I open external windows using initWithWindowNibName. This works fine.

Then in willUnselect, I call [window orderOut:self]; for each external window and they correctly hide. This will happen for example if the user switches from my PrefPane to the Sound or Network PrefPane.

When they come back to my PrefPane, I get willSelect and call:

[window orderWindow:NSWindowAbove relativeTo:0];

This call no longer works (it works in all versions of 10.14.6 and earlier and may work in early versions of 10.15, but it definitely broken in 10.15.6).

I have tried using other methods to hide/show the windows including [window setIsVisible:] but nothing works to restore the window.

I think it might be related to something this blog discusses:

https://www.noodlesoft.com/blog/2019/08/28/preference-panes-and-catalina/

Has anyone seen this or know a fix for it?


Solution

  • After working with Apple DTS, this is expected behavior in that PrefPanes now run in a separate process and that process does not expect panes to open additional windows.

    It is still possible to open/close windows within didSelect, but that is more of a side-effect and may not work in the long run. We have decided to pull our software out of System Preferences and into a regular application to ensure long term compatibility.