[Scummvm-git-logs] scummvm branch-2-1 -> 618dc89e7a6b80503fa2fe2bc5ca032f3127e846
criezy
criezy at scummvm.org
Mon Mar 30 19:29:47 UTC 2020
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b380ae30ea MACOSX: Check selector exists when trying to replace application menus
d61356cd0d MACOSX: Add detection of target OS version in configure
618dc89e7a MACOSX: Fix legacy icon for old Mac OS X versions
Commit: b380ae30ea25d293d47635d80976011d7a958a96
https://github.com/scummvm/scummvm/commit/b380ae30ea25d293d47635d80976011d7a958a96
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2020-03-30T20:28:26+01:00
Commit Message:
MACOSX: Check selector exists when trying to replace application menus
In particular it has been reported that setHelpMenu was introduced in
MacOS X 10.6. So hopefully this change will fix running ScummVM on
MacOS X 10.5 or older.
This might fix bug #11260: MAC OS X: App incomplete when launched on
OS X 10.5.8.
Changed paths:
backends/platform/sdl/macosx/appmenu_osx.mm
diff --git a/backends/platform/sdl/macosx/appmenu_osx.mm b/backends/platform/sdl/macosx/appmenu_osx.mm
index 38ce8c49a2..0263b95fe2 100644
--- a/backends/platform/sdl/macosx/appmenu_osx.mm
+++ b/backends/platform/sdl/macosx/appmenu_osx.mm
@@ -137,6 +137,10 @@ NSString *constructNSStringFromCString(const char *rawCString, CFStringEncoding
}
static NSMenu *addMenu(const char *title, CFStringEncoding encoding, NSString *key, SEL setAs) {
+ if (setAs && ![NSApp respondsToSelector:setAs]) {
+ return nil;
+ }
+
NSString *str = constructNSStringFromCString(title, encoding);
NSMenu *menu = [[NSMenu alloc] initWithTitle:str];
@@ -178,10 +182,6 @@ void releaseMenu() {
}
void replaceApplicationMenuItems() {
- if (!delegate) {
- delegate = [[ScummVMMenuHandler alloc] init];
- }
-
// We cannot use [[NSApp mainMenu] removeAllItems] as removeAllItems was added in OS X 10.6
// So remove the SDL generated menus one by one instead.
while ([[NSApp mainMenu] numberOfItems] > 0) {
@@ -200,30 +200,38 @@ void replaceApplicationMenuItems() {
#endif
NSMenu *appleMenu = addMenu("ScummVM", kCFStringEncodingASCII, @"", @selector(setAppleMenu:));
- addMenuItem(_("About ScummVM"), stringEncoding, nil, @selector(orderFrontStandardAboutPanel:), @"", appleMenu);
- [appleMenu addItem:[NSMenuItem separatorItem]];
- addMenuItem(_("Hide ScummVM"), stringEncoding, nil, @selector(hide:), @"h", appleMenu);
- addMenuItem(_("Hide Others"), stringEncoding, nil, @selector(hideOtherApplications:), @"h", appleMenu, (NSEventModifierFlagOption|NSEventModifierFlagCommand));
- addMenuItem(_("Show All"), stringEncoding, nil, @selector(unhideAllApplications:), @"", appleMenu);
- [appleMenu addItem:[NSMenuItem separatorItem]];
- addMenuItem(_("Quit ScummVM"), stringEncoding, nil, @selector(terminate:), @"q", appleMenu);
+ if (appleMenu) {
+ addMenuItem(_("About ScummVM"), stringEncoding, nil, @selector(orderFrontStandardAboutPanel:), @"", appleMenu);
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+ addMenuItem(_("Hide ScummVM"), stringEncoding, nil, @selector(hide:), @"h", appleMenu);
+ addMenuItem(_("Hide Others"), stringEncoding, nil, @selector(hideOtherApplications:), @"h", appleMenu, (NSEventModifierFlagOption|NSEventModifierFlagCommand));
+ addMenuItem(_("Show All"), stringEncoding, nil, @selector(unhideAllApplications:), @"", appleMenu);
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+ addMenuItem(_("Quit ScummVM"), stringEncoding, nil, @selector(terminate:), @"q", appleMenu);
+ }
NSMenu *windowMenu = addMenu(_("Window"), stringEncoding, @"", @selector(setWindowsMenu:));
- addMenuItem(_("Minimize"), stringEncoding, nil, @selector(performMiniaturize:), @"m", windowMenu);
+ if (windowMenu) {
+ addMenuItem(_("Minimize"), stringEncoding, nil, @selector(performMiniaturize:), @"m", windowMenu);
+ }
NSMenu *helpMenu = addMenu(_("Help"), stringEncoding, @"", @selector(setHelpMenu:));
- addMenuItem(_("User Manual"), stringEncoding, delegate, @selector(openUserManual), @"", helpMenu);
- [helpMenu addItem:[NSMenuItem separatorItem]];
- addMenuItem(_("General Information"), stringEncoding, delegate, @selector(openReadme), @"", helpMenu);
- addMenuItem(_("What's New in ScummVM"), stringEncoding, delegate, @selector(openNews), @"", helpMenu);
- [helpMenu addItem:[NSMenuItem separatorItem]];
- addMenuItem(_("Credits"), stringEncoding, delegate, @selector(openCredits), @"", helpMenu);
- addMenuItem(_("GPL License"), stringEncoding, delegate, @selector(openLicenseGPL), @"", helpMenu);
- addMenuItem(_("LGPL License"), stringEncoding, delegate, @selector(openLicenseLGPL), @"", helpMenu);
- addMenuItem(_("Freefont License"), stringEncoding, delegate, @selector(openLicenseFreefont), @"", helpMenu);
- addMenuItem(_("OFL License"), stringEncoding, delegate, @selector(openLicenseOFL), @"", helpMenu);
- addMenuItem(_("BSD License"), stringEncoding, delegate, @selector(openLicenseBSD), @"", helpMenu);
-
+ if (helpMenu) {
+ if (!delegate) {
+ delegate = [[ScummVMMenuHandler alloc] init];
+ }
+ addMenuItem(_("User Manual"), stringEncoding, delegate, @selector(openUserManual), @"", helpMenu);
+ [helpMenu addItem:[NSMenuItem separatorItem]];
+ addMenuItem(_("General Information"), stringEncoding, delegate, @selector(openReadme), @"", helpMenu);
+ addMenuItem(_("What's New in ScummVM"), stringEncoding, delegate, @selector(openNews), @"", helpMenu);
+ [helpMenu addItem:[NSMenuItem separatorItem]];
+ addMenuItem(_("Credits"), stringEncoding, delegate, @selector(openCredits), @"", helpMenu);
+ addMenuItem(_("GPL License"), stringEncoding, delegate, @selector(openLicenseGPL), @"", helpMenu);
+ addMenuItem(_("LGPL License"), stringEncoding, delegate, @selector(openLicenseLGPL), @"", helpMenu);
+ addMenuItem(_("Freefont License"), stringEncoding, delegate, @selector(openLicenseFreefont), @"", helpMenu);
+ addMenuItem(_("OFL License"), stringEncoding, delegate, @selector(openLicenseOFL), @"", helpMenu);
+ addMenuItem(_("BSD License"), stringEncoding, delegate, @selector(openLicenseBSD), @"", helpMenu);
+ }
[appleMenu release];
[windowMenu release];
Commit: d61356cd0d61482710943389c2a68c90de576878
https://github.com/scummvm/scummvm/commit/d61356cd0d61482710943389c2a68c90de576878
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2020-03-30T20:28:47+01:00
Commit Message:
MACOSX: Add detection of target OS version in configure
This is used for two purposes:
1. Use the new legacy icon when targeting 10.5 or older. This fixes
bug #11261 MAC OS X: App icon doesnât display on OS X 10.5.8.
2. Do not attempt to compile the dock plugin in 32 bits when
targeting 10.14 or newer. This fixes the bundle target as support
for compiling 32 bits binaries was removed in SDK 10.14.
This commit also removes the bundle64 target as it is no longer
needed.
Changed paths:
A icons/scummvm_legacy.icns
configure
ports.mk
diff --git a/configure b/configure
index 125377621b..28db44c5a6 100755
--- a/configure
+++ b/configure
@@ -2767,6 +2767,38 @@ case $_host_os in
fi
fi
+ # When building for MacOS X 10.5 we need to use the legacy icon
+ echocheck "macOS SDK target version at least 10.6"
+ _macos_atleast_10_6=no
+ cat > $TMPC << EOF
+#include "AvailabilityMacros.h"
+#if !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
+error
+#endif
+int main(int argc, char *argv[]) { return 0; }
+EOF
+ cc_check && _macos_atleast_10_6=yes
+ echo ${_macos_atleast_10_6}
+ if test "$_macos_atleast_10_6" = no ; then
+ add_line_to_config_mk 'MACOSX_USE_LEGACY_ICONS = 1'
+ fi
+
+ # When building with SDK 10.14 or above, we cannot compile the 32 bits dock plugin
+ echocheck "macOS SDK target version at least 10.14"
+ _macos_atleast_10_14=no
+ cat > $TMPC << EOF
+#include "AvailabilityMacros.h"
+#if !defined(MAC_OS_X_VERSION_10_14) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14
+error
+#endif
+int main(int argc, char *argv[]) { return 0; }
+EOF
+ cc_check && _macos_atleast_10_14=yes
+ echo ${_macos_atleast_10_14}
+ if test "$_macos_atleast_10_14" = yes ; then
+ add_line_to_config_mk 'MACOSX_64_BITS_ONLY = 1'
+ fi
+
# Use pandoc to generate README and NEWS file for the bundle
# Also default to HTML rather than plain text as it gives a nicer
# formating, especially for the README. We could consider using RTF
diff --git a/icons/scummvm_legacy.icns b/icons/scummvm_legacy.icns
new file mode 100644
index 0000000000..1cd6a742ab
Binary files /dev/null and b/icons/scummvm_legacy.icns differ
diff --git a/ports.mk b/ports.mk
index 024bf2879d..efcd0398b1 100644
--- a/ports.mk
+++ b/ports.mk
@@ -81,8 +81,13 @@ ScummVMDockTilePlugin64.o:
ScummVMDockTilePlugin64: ScummVMDockTilePlugin64.o
$(CXX) -mmacosx-version-min=10.6 -arch x86_64 -bundle -framework Foundation -framework AppKit -fobjc-link-runtime ScummVMDockTilePlugin64.o -o ScummVMDockTilePlugin64
+ifdef MACOSX_64_BITS_ONLY
+ScummVMDockTilePlugin: ScummVMDockTilePlugin64
+ cp ScummVMDockTilePlugin64 ScummVMDockTilePlugin
+else
ScummVMDockTilePlugin: ScummVMDockTilePlugin32 ScummVMDockTilePlugin64
lipo -create ScummVMDockTilePlugin32 ScummVMDockTilePlugin64 -output ScummVMDockTilePlugin
+endif
scummvm.docktileplugin: ScummVMDockTilePlugin
mkdir -p scummvm.docktileplugin/Contents
@@ -91,14 +96,6 @@ scummvm.docktileplugin: ScummVMDockTilePlugin
cp ScummVMDockTilePlugin scummvm.docktileplugin/Contents/MacOS/
chmod 644 scummvm.docktileplugin/Contents/MacOS/ScummVMDockTilePlugin
-scummvm.docktileplugin64: ScummVMDockTilePlugin64
- mkdir -p scummvm.docktileplugin/Contents
- cp $(srcdir)/dists/macosx/dockplugin/Info.plist scummvm.docktileplugin/Contents
- mkdir -p scummvm.docktileplugin/Contents/MacOS
- mv ScummVMDockTilePlugin64 ScummVMDockTilePlugin
- cp ScummVMDockTilePlugin scummvm.docktileplugin/Contents/MacOS/
- chmod 644 scummvm.docktileplugin/Contents/MacOS/ScummVMDockTilePlugin
-
endif
bundle_name = ScummVM.app
@@ -114,7 +111,11 @@ ifdef USE_SPARKLE
rm -rf $(bundle_name)/Contents/Frameworks/Sparkle.framework
cp -R $(SPARKLEPATH)/Sparkle.framework $(bundle_name)/Contents/Frameworks/
endif
- cp $(srcdir)/icons/scummvm.icns $(bundle_name)/Contents/Resources/
+ifdef MACOSX_USE_LEGACY_ICONS
+ cp $(srcdir)/icons/scummvm_legacy.icns $(bundle_name)/Contents/Resources/scummvm.icns
+else
+ cp $(srcdir)/icons/scummvm.icns $(bundle_name)/Contents/Resources/scummvm.icns
+endif
cp $(DIST_FILES_DOCS) $(bundle_name)/Contents/Resources/
cp $(DIST_FILES_THEMES) $(bundle_name)/Contents/Resources/
ifdef DIST_FILES_NETWORKING
@@ -143,12 +144,8 @@ endif
ifdef USE_DOCKTILEPLUGIN
bundle: scummvm-static scummvm.docktileplugin bundle-pack
-
-bundle64: scummvm-static scummvm.docktileplugin64 bundle-pack
else
bundle: scummvm-static bundle-pack
-
-bundle64: scummvm-static bundle-pack
endif
iphonebundle: iphone
Commit: 618dc89e7a6b80503fa2fe2bc5ca032f3127e846
https://github.com/scummvm/scummvm/commit/618dc89e7a6b80503fa2fe2bc5ca032f3127e846
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2020-03-30T20:28:58+01:00
Commit Message:
MACOSX: Fix legacy icon for old Mac OS X versions
Changed paths:
icons/scummvm_legacy.icns
diff --git a/icons/scummvm_legacy.icns b/icons/scummvm_legacy.icns
index 1cd6a742ab..9a6b484c6d 100644
Binary files a/icons/scummvm_legacy.icns and b/icons/scummvm_legacy.icns differ
More information about the Scummvm-git-logs
mailing list