Opened 4 years ago

Last modified 4 years ago

#11260 closed defect

MAC OS X: App incomplete when launched on OS X 10.5.8. — at Version 2

Reported by: macca8 Owned by:
Priority: blocker Component: Port: Mac OS X
Version: Keywords:
Cc: Game:

Description (last modified by macca8)

This issue dates back to when the Help Menu was added to ScummVM’s application menu (28/29 August 2018)… earlier builds that predate this event (for example, a daily build from 8 June 2018 & the v2.0.0 release) launch correctly.

Affected ScummVM build: All current 32bit mac builds (includes v2.2.0git daily, v2.1.1pre daily, v2.1.0 PPC release, v2.1.0 intel release).
Platform: Intel Mac & PPC Mac (OS X 10.5.8)

When launching any current 32bit build on OS X 10.5.8, the app launches in an incomplete and unresponsive state when it fails to populate the app’s Help Menu… the only object present is the search box (later versions of macOS load the Help Menu correctly and don’t have this issue).

The side effects of this are:

  • the ScummVM window is never launched.
  • the cursor disappears (can be revealed by scrolling to the bottom of the screen).
  • the user must Force Quit to close the app (can be activated from the Dock).

I’m using an Intel Mac, but these side effects also apply to PPC Macs (as reported by a user in https://forums.scummvm.org/viewtopic.php?f=2&t=14967#p87856 .

There’s no crash report, but the Mac OS X console reports the following:
7/11/19 2:12:47 PM scummvm[xxx] NSDocumentController Info.plist warning: The values of CFBundleTypeRole entries must be 'Editor', 'Viewer', 'None', or 'Shell'.
7/11/19 2:12:47 PM scummvm[xxx] * -[NSApplication setHelpMenu:]: unrecognized selector sent to instance 0x30115a0
7/11/19 2:12:47 PM scummvm[xxx] Exception raised during posting of notification. Ignored. exception: '* -[NSApplication setHelpMenu:]: unrecognized selector sent to instance 0x30115a0' invoked observer method: '* -[SDLMain applicationDidFinishLaunching:]' observer: 0x3022330 notification name: 'NSApplicationDidFinishLaunchingNotification'
7/11/19 2:13:56 PM com.apple.launchd[xx] ([0x0-0x25025].org.scummvm.scummvm[xxx]) Exited: Killed

The last line of the report refers to a Force Quit, and the first is a warning that appears even on successful launches.

The scummvm.log reports 'log opened'.

Note that this behaviour dates back to at least a daily build from 15 September 2018.
Also, unlike all the other builds (including the v2.1.0 OSX PPC release), the v2.1.0 intel release actually crashes immediately on launch (no backtrace is available on the crash report), though this may be related to an unresolved crash on OS X 10.6.8 involving the same build (refer #11203).

Change History (4)

comment:1 by macca8, 4 years ago

Criezy, responding to your request in the Forums for feedback on the OSX PPC v2.1.0 release build.

I’ve tested this version under Rosetta on my Intel iMac running both 10.5 & 10.6. I can confirm that the app performs perfectly on 10.6 (not that that is of any value to a user with a PowerPC Mac), but on 10.5 it behaves exactly as reported above for the Intel Mac daily builds, including the macOS console report.

Out of curiosity, which version of SDL is included in the OSX PPC release build?

May I humbly suggest that we focus on resolving the only bug reported by the macOS console (the Help Menu error for the OSX PPC release & Intel Mac daily builds), then see how the various builds respond.

According to developer.apple.com, and other online sources - including another project that displayed the same selector error on macOS 10.5 - [NSApplication setHelpMenu] is NOT available until macOS 10.6.

The solution offered by the other project was to restrict the Help Menu to macOS 10.6 & later, and I believe that to be the appropriate course of action here as well, given that the current implementation of the Help Menu works perfectly with those later versions of macOS.

As such, there’s no need to change the current code, other than to place restrictions on its use.

With that in mind, may I suggest the following:

  • Define macOS 10.6 (in backends/platform/sdl/macosx/macosx-compat.h):

#ifndef MAC_OS_X_VERSION_10_6
#define MAC_OS_X_VERSION_10_6 1060
#endif

  • Restrict the construction of the Help Menu to macOS 10.6 & later by adding an appropriate conditional statement, for example:

#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
targeted code goes here
#endif

Apply this statement as necessary in backends/platform/sdl/macosx/appmenu_osx.mm.

Include each of these code segments within its own statement:

  1. Everything relevant to the delegate variable, including:
  • line 173

static ScummVMMenuHandler *delegate = nullptr;

  • lines 176-177 (in releaseMenu())

[delegate release];
delegate = nullptr;

  • lines 181-183 (in replaceApplicationMenuItems())

if (!delegate) {

delegate = [[ScummVMMenuHandler alloc] init];

}

  1. Everything relevant to the helpMenu variable, including:
  • lines 214-225 (in replaceApplicationMenuItems())

NSMenu *helpMenu = addMenu(_("Help"),…;
to
addMenuItem(_("BSD License"),…;

  • line 230 (in replaceApplicationMenuItems())

[helpMenu release];

Please note that, as presented, only macosx-compat.h & appmenu_osx.mm need adjusting. Also, I’ve avoided consolidating any of the code segments (in replaceApplicationMenuItems()) to preserve the existing flow of events in macOS 10.6 & later.

I would appreciate your support with this, as I see no downside to making this change.
At worst, we eliminate a known issue, while establishing if other factors are affecting the launch.

Since you can’t test the changes personally on macOS 10.5, by adding them to master I can at least give you feedback by testing the developmental build.

I’ve attached copies of both files to clarify the proposed changes.

Last edited 4 years ago by macca8 (previous) (diff)

by macca8, 4 years ago

Attachment: appmenu_osx.rtf added

by macca8, 4 years ago

Attachment: macosx-compat.rtf added

comment:2 by macca8, 4 years ago

Description: modified (diff)
Summary: MAC OS X: App stalls when launched on OS X 10.5.8.MAC OS X: App incomplete when launched on OS X 10.5.8.
Note: See TracTickets for help on using tickets.