[Scummvm-git-logs] scummvm master -> 8781ba023b35f4d577d20a220fcde93a2643998f
sev-
noreply at scummvm.org
Wed Jan 28 01:05:59 UTC 2026
This automated email contains information about 11 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
a99ab88f07 MACOS: Restore original comment about setAppleMenu()
f76c9272eb MACOS: Let openUserManual() work on OSX 10.4
73d8e05e36 MACOS: Provide a Help menu on OSX 10.4/10.5 as well
776e0c9c8c MACOS: Avoid any 'remainingRange' getBytes call in getTextFromClipboard()
0ac817b260 MACOS: Fix getMacBundleName() compilation warning on older OSX
4bba9a662b MACOS: Replace `valueForKey` NSDictionary call with `objectForKey`
820eeff96f MACOS: Add a bit more of NSDockTile compat code for 10.4
197c7cbb49 MACOS: Fix __MAC_OS_X_VERSION_MAX_ALLOWED macro not being always defined
9918bc1cb4 MACOS: Handle SDK < 10.6 incomplete setShowsHiddenFiles support
e73d4ef22f MACOS: Add NSThread.h to avoid compilation warnings on older OSX
8781ba023b BUILD: MACOS: Add UTF-8 BOM to doc files for OSX 10.4/10.5 .dmg file
Commit: a99ab88f070c319aa962a4d3ace59145ad766c80
https://github.com/scummvm/scummvm/commit/a99ab88f070c319aa962a4d3ace59145ad766c80
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-01-28T04:05:50+03:00
Commit Message:
MACOS: Restore original comment about setAppleMenu()
AFAICS, looking at the content of various SDK releases, setAppleMenu()
really is an old API that Apple removed from the 10.4 SDK (although the
symbol itself was preserved after that).
Restored from commit ef62422e59d691c944838f9da3ac868821d4797c.
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 df0b96d3470..94789118bce 100644
--- a/backends/platform/sdl/macosx/appmenu_osx.mm
+++ b/backends/platform/sdl/macosx/appmenu_osx.mm
@@ -58,8 +58,8 @@ enum {
#endif
#endif
-// Apple added setAppleMenu in 10.5 and removed it in 10.6.
-// But as the method still exists we declare it ourselves here.
+// Apple removed setAppleMenu from the header files in 10.4,
+// but as the method still exists we declare it ourselves here.
// Yes, this works :)
@interface NSApplication(MissingFunction)
- (void)setAppleMenu:(NSMenu *)menu;
Commit: f76c9272eba8bb00ff9fbdfc269925cf428954e9
https://github.com/scummvm/scummvm/commit/f76c9272eba8bb00ff9fbdfc269925cf428954e9
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-01-28T04:05:50+03:00
Commit Message:
MACOS: Let openUserManual() work on OSX 10.4
We can just use `directoryContentsAtPath` when targeting 10.4, as
we're not using the `error` feature of `contentsOfDirectoryAtPath`
anyway.
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 94789118bce..4864ac6f081 100644
--- a/backends/platform/sdl/macosx/appmenu_osx.mm
+++ b/backends/platform/sdl/macosx/appmenu_osx.mm
@@ -201,10 +201,15 @@ static void openFromBundle(NSString *file, NSString *subdir = nil) {
}
- (void)openUserManual {
+ NSString *bundlePath = [[NSBundle mainBundle] resourcePath];
+
// If present locally in the bundle, open that file.
- if ([[NSFileManager defaultManager] respondsToSelector:@selector(contentsOfDirectoryAtPath:error:)]) {
- NSString *bundlePath = [[NSBundle mainBundle] resourcePath];
- NSArray *dirContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:bundlePath error:nil];
+#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
+ NSArray *dirContents = [[NSFileManager defaultManager] directoryContentsAtPath:bundlePath];
+#else
+ NSArray *dirContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:bundlePath error:nil];
+#endif
+ if (dirContents != nil) {
NSEnumerator *dirEnum = [dirContents objectEnumerator];
NSString *file;
Commit: 73d8e05e36cb00c8956df32ce6ea142429810f36
https://github.com/scummvm/scummvm/commit/73d8e05e36cb00c8956df32ce6ea142429810f36
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-01-28T04:05:50+03:00
Commit Message:
MACOS: Provide a Help menu on OSX 10.4/10.5 as well
There's no `setHelpMenu:` there, but giving a nil value to addMenu(),
and making sure it's created last (which is already the case) is
actually enough.
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 4864ac6f081..136dc359c1f 100644
--- a/backends/platform/sdl/macosx/appmenu_osx.mm
+++ b/backends/platform/sdl/macosx/appmenu_osx.mm
@@ -312,9 +312,11 @@ void replaceApplicationMenuItems() {
addMenuItem(_("Minimize"), nil, @selector(performMiniaturize:), @"m", windowMenu);
}
- // Note: this part is expected not to work at run-time on 10.5 and earlier,
- // because setHelpMenu is only available on 10.6+ (see Bug#11260).
- NSMenu *helpMenu = addMenu(_("Help"), @"", @selector(setHelpMenu:));
+ // Note: special care must be taken for the Help menu before 10.6,
+ // as setHelpMenu didn't exist yet: give an explicit nil for it in
+ // addMenu(), and also make sure it's created last.
+ SEL helpMenuSelector = [NSApp respondsToSelector:@selector(setHelpMenu:)] ? @selector(setHelpMenu:) : nil;
+ NSMenu *helpMenu = addMenu(_("Help"), @"", helpMenuSelector);
if (helpMenu) {
if (!delegate) {
delegate = [[ScummVMMenuHandler alloc] init];
Commit: 776e0c9c8c47d8b77107a7995d7b3dbba687de00
https://github.com/scummvm/scummvm/commit/776e0c9c8c47d8b77107a7995d7b3dbba687de00
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-01-28T04:05:50+03:00
Commit Message:
MACOS: Avoid any 'remainingRange' getBytes call in getTextFromClipboard()
The `-getBytes:...:remainingRange:` API is missing from the 10.4 SDK
headers, so rewrite the code so that it uses APIs available to 10.4
and all current releases.
See GH-3416 PR for original context.
(Actually, the Foundation framework in OSX 10.4 *does* have a symbol
for it, but it's undocumented, not in the headers, and hidden. So it
just feels safer to rewrite it with more portable code.)
Changed paths:
backends/platform/sdl/macosx/macosx_osys_misc.mm
diff --git a/backends/platform/sdl/macosx/macosx_osys_misc.mm b/backends/platform/sdl/macosx/macosx_osys_misc.mm
index 3e29a09fde6..cf7a5742c7d 100644
--- a/backends/platform/sdl/macosx/macosx_osys_misc.mm
+++ b/backends/platform/sdl/macosx/macosx_osys_misc.mm
@@ -31,6 +31,7 @@
#include "base/version.h"
#include <Foundation/NSBundle.h>
+#include <Foundation/NSData.h>
#include <Foundation/NSFileManager.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSPathUtilities.h>
@@ -137,7 +138,7 @@ Common::U32String OSystem_MacOSX::getTextFromClipboard() {
NSPasteboard *pb = [NSPasteboard generalPasteboard];
NSString *str = [pb stringForType:NSPasteboardTypeString];
- if (![str respondsToSelector:@selector(getBytes:maxLength:usedLength:encoding:options:range:remainingRange:)])
+ if (str == nil)
return Common::U32String();
// If translations are supported, use the current TranslationManager charset and otherwise
@@ -148,12 +149,22 @@ Common::U32String OSystem_MacOSX::getTextFromClipboard() {
#else
NSStringEncoding stringEncoding = NSUTF32BigEndianStringEncoding;
#endif
- NSUInteger textLength = [str length];
- Common::u32char_type_t *text = new Common::u32char_type_t[textLength];
- if (![str getBytes:text maxLength:4*textLength usedLength:NULL encoding: stringEncoding options:0 range:NSMakeRange(0, textLength) remainingRange:NULL]) {
- delete[] text;
+ NSData *data = [str dataUsingEncoding:stringEncoding];
+ if (data == nil)
return Common::U32String();
- }
+
+ NSUInteger byteLength = [data length];
+ if (byteLength % 4 != 0)
+ return Common::U32String();
+
+ NSUInteger textLength = byteLength / 4;
+ Common::u32char_type_t *text = new Common::u32char_type_t[textLength];
+
+ // note: Using the `-getBytes:...:remainingRange:` API would make this code
+ // a bit simpler, but it's missing from the 10.4 SDK headers (although the
+ // Foundation framework seems to contain some hidden symbol for it...)
+ [data getBytes:text length:byteLength];
+
Common::U32String u32String(text, textLength);
delete[] text;
Commit: 0ac817b2602980529dbf2493bd8127eee0af714b
https://github.com/scummvm/scummvm/commit/0ac817b2602980529dbf2493bd8127eee0af714b
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-01-28T04:05:50+03:00
Commit Message:
MACOS: Fix getMacBundleName() compilation warning on older OSX
Looks like it wants an explicit NSDictionary.h include to avoid any
compilation warning about `objectForKey`.
(At least on 10.4/10.5.)
Changed paths:
backends/platform/sdl/macosx/macosx_wrapper.mm
diff --git a/backends/platform/sdl/macosx/macosx_wrapper.mm b/backends/platform/sdl/macosx/macosx_wrapper.mm
index ece5b32f422..96c7e723719 100644
--- a/backends/platform/sdl/macosx/macosx_wrapper.mm
+++ b/backends/platform/sdl/macosx/macosx_wrapper.mm
@@ -27,6 +27,7 @@
#include <Foundation/NSArray.h>
#include <Foundation/NSBundle.h>
+#include <Foundation/NSDictionary.h>
#include <Foundation/NSPathUtilities.h>
#include <AvailabilityMacros.h>
#include <CoreFoundation/CFString.h>
Commit: 4bba9a662b2489c9b3d5b6ace6aad83dc7b41f03
https://github.com/scummvm/scummvm/commit/4bba9a662b2489c9b3d5b6ace6aad83dc7b41f03
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-01-28T04:05:50+03:00
Commit Message:
MACOS: Replace `valueForKey` NSDictionary call with `objectForKey`
Tiger issued a warning about it, and `objectForKey` tends to be
recommended over `valueForKey` for NSDictionary anyway -- and this
also silences the warning, along the way.
Changed paths:
backends/taskbar/macosx/macosx-taskbar.mm
diff --git a/backends/taskbar/macosx/macosx-taskbar.mm b/backends/taskbar/macosx/macosx-taskbar.mm
index 91f09d17077..4c22d9827c4 100644
--- a/backends/taskbar/macosx/macosx-taskbar.mm
+++ b/backends/taskbar/macosx/macosx-taskbar.mm
@@ -253,7 +253,7 @@ void MacOSXTaskbarManager::addRecent(const Common::String &name, const Common::S
NSDictionary *oldDict = [newArray objectAtIndex:i];
if (oldDict == nil)
continue;
- NSString *oldGame = [oldDict valueForKey:@"game"];
+ NSString *oldGame = [oldDict objectForKey:@"game"];
if (oldGame != nil && [oldGame isEqualToString:(NSString*)gameName]) {
[newArray removeObjectAtIndex:i];
break;
Commit: 820eeff96f76d519d5af85906f140858c81adc6b
https://github.com/scummvm/scummvm/commit/820eeff96f76d519d5af85906f140858c81adc6b
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-01-28T04:05:50+03:00
Commit Message:
MACOS: Add a bit more of NSDockTile compat code for 10.4
The idea is that, although this feature is 10.5+ only, it should be
able to be built on 10.4, and the newer paths be only executed at
run time.
But when building on 10.4, a small `dockTile` warning was left;
just pick a bit more context from the 10.5 SDK to help it.
Changed paths:
backends/taskbar/macosx/macosx-taskbar.mm
diff --git a/backends/taskbar/macosx/macosx-taskbar.mm b/backends/taskbar/macosx/macosx-taskbar.mm
index 4c22d9827c4..8d5ea3a4729 100644
--- a/backends/taskbar/macosx/macosx-taskbar.mm
+++ b/backends/taskbar/macosx/macosx-taskbar.mm
@@ -44,6 +44,9 @@
// use this feature at run-time on 10.5+.
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
typedef id NSDockTilePtr;
+ at interface NSApplication(MissingFunction)
+- (NSDockTilePtr)dockTile;
+ at end
#else
#include <AppKit/NSDockTile.h>
typedef NSDockTile * NSDockTilePtr;
Commit: 197c7cbb491197575dcfb23780439a212c54b307
https://github.com/scummvm/scummvm/commit/197c7cbb491197575dcfb23780439a212c54b307
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-01-28T04:05:50+03:00
Commit Message:
MACOS: Fix __MAC_OS_X_VERSION_MAX_ALLOWED macro not being always defined
Use <AvailabilityMacros.h> and MAC_OS_X_VERSION_MAX_ALLOWED, instead of
__MAC_OS_X_VERSION_MAX_ALLOWED, which isn't always defined.
Changed paths:
backends/dialogs/macosx/macosx-dialogs.mm
diff --git a/backends/dialogs/macosx/macosx-dialogs.mm b/backends/dialogs/macosx/macosx-dialogs.mm
index a6244eab0a2..584e69bb74c 100644
--- a/backends/dialogs/macosx/macosx-dialogs.mm
+++ b/backends/dialogs/macosx/macosx-dialogs.mm
@@ -31,6 +31,7 @@
#include "common/algorithm.h"
#include "common/translation.h"
+#include <AvailabilityMacros.h>
#include <AppKit/NSNibDeclarations.h>
#include <AppKit/NSOpenPanel.h>
#include <AppKit/NSApplication.h>
@@ -39,7 +40,7 @@
#include <Foundation/NSURL.h>
#include <Foundation/NSAutoreleasePool.h>
-#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101400
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
#ifndef NSControlStateValueOff
#define NSControlStateValueOff NSOffState
Commit: 9918bc1cb40d0a29c7ba974074eb6daccd0b20b7
https://github.com/scummvm/scummvm/commit/9918bc1cb40d0a29c7ba974074eb6daccd0b20b7
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-01-28T04:05:50+03:00
Commit Message:
MACOS: Handle SDK < 10.6 incomplete setShowsHiddenFiles support
showsHiddenFiles and setShowsHiddenFiles do exist in 10.4, but the
SDK headers are missing them.
The 10.6 SDK documents this:
"This method was published in OSX 10.6, but has existed since
OSX 10.4."
So, this means we can just use them in 10.4-10.5 (and fix a compiler
warning there), as long as we add the missing header declarations.
Changed paths:
backends/dialogs/macosx/macosx-dialogs.mm
diff --git a/backends/dialogs/macosx/macosx-dialogs.mm b/backends/dialogs/macosx/macosx-dialogs.mm
index 584e69bb74c..a50e2ce7c38 100644
--- a/backends/dialogs/macosx/macosx-dialogs.mm
+++ b/backends/dialogs/macosx/macosx-dialogs.mm
@@ -40,6 +40,20 @@
#include <Foundation/NSURL.h>
#include <Foundation/NSAutoreleasePool.h>
+// From the 10.6 SDK:
+// "This method was published in 10.6, but has existed since 10.4."
+//
+// This means that the feature works on 10.4/10.5 as well, but their SDK
+// headers didn't expose it at all. I've checked that it does work at runtime,
+// but we stil keep some respondsToSelector safety calls below, in case its
+// symbols were only added in some later 10.4 update or something.
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
+ at interface NSSavePanel(Undocumented)
+- (BOOL)showsHiddenFiles;
+- (void)setShowsHiddenFiles:(BOOL)flag;
+ at end
+#endif
+
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
#ifndef NSControlStateValueOff
@@ -84,7 +98,9 @@
_panel = panel;
NSButton *showHiddenFilesButton = 0;
- if ([panel respondsToSelector:@selector(setShowsHiddenFiles:)]) {
+ // note: still doing some respondsToSelector tests, because on Tiger/Leopard
+ // the API was undocumented.
+ if ([panel respondsToSelector:@selector(showsHiddenFiles)] && [panel respondsToSelector:@selector(setShowsHiddenFiles:)]) {
showHiddenFilesButton = [[NSButton alloc] init];
[showHiddenFilesButton setButtonType:NSButtonTypeSwitch];
Commit: e73d4ef22fa7920cccf13b041eeb90ce0f3d1df8
https://github.com/scummvm/scummvm/commit/e73d4ef22fa7920cccf13b041eeb90ce0f3d1df8
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-01-28T04:05:50+03:00
Commit Message:
MACOS: Add NSThread.h to avoid compilation warnings on older OSX
At least 10.4 wants it, to avoid warnings around the use of
performSelectorOnMainThread.
Changed paths:
backends/dialogs/macosx/macosx-dialogs.mm
diff --git a/backends/dialogs/macosx/macosx-dialogs.mm b/backends/dialogs/macosx/macosx-dialogs.mm
index a50e2ce7c38..6233afcc370 100644
--- a/backends/dialogs/macosx/macosx-dialogs.mm
+++ b/backends/dialogs/macosx/macosx-dialogs.mm
@@ -38,6 +38,7 @@
#include <AppKit/NSButton.h>
#include <Foundation/NSString.h>
#include <Foundation/NSURL.h>
+#include <Foundation/NSThread.h>
#include <Foundation/NSAutoreleasePool.h>
// From the 10.6 SDK:
Commit: 8781ba023b35f4d577d20a220fcde93a2643998f
https://github.com/scummvm/scummvm/commit/8781ba023b35f4d577d20a220fcde93a2643998f
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-01-28T04:05:50+03:00
Commit Message:
BUILD: MACOS: Add UTF-8 BOM to doc files for OSX 10.4/10.5 .dmg file
When one opens the .dmg file on OSX 10.4/10.5, the translated
documentation that's included currently has rendering problem in
TextEdit and in (Leopard's) QuickLook.
In later macOS releases, the (existing) `com.apple.TextEncoding` xattr
trick does its job in helping the system recognize they're UTF-8 files,
but OSX 10.4/10.5 still had some hardcoded fallbacks on MacRoman, even
when xattr is used (and the 10.4 UI mostly ignores xattr values anyway).
So, when building a .dmg file for OSX 10.4/10.5 (and only in this case),
we (sadly) have to embed a UTF-8 BOM in this set of files, as this is
the only way for them to be properly displayed to users.
(Move the `SetFile` calls after this is done, as the Perl call drops
existing file attributes on its targets.)
Changed paths:
ports.mk
diff --git a/ports.mk b/ports.mk
index 44b997aadd9..af53e1787c5 100644
--- a/ports.mk
+++ b/ports.mk
@@ -651,11 +651,13 @@ osxsnap: bundle
cp $(DIST_FILES_DOCS_no-nb) ./ScummVM-snapshot/doc/no-nb/
mkdir ScummVM-snapshot/doc/sv
cp $(DIST_FILES_DOCS_se) ./ScummVM-snapshot/doc/sv/
- $(XCODETOOLSPATH)/SetFile -t ttro -c ttxt ./ScummVM-snapshot/doc/QuickStart
- $(XCODETOOLSPATH)/SetFile -t ttro -c ttxt ./ScummVM-snapshot/doc/*/*
-ifndef MACOSX_LEOPARD_OR_BELOW
+ifdef MACOSX_LEOPARD_OR_BELOW
+ perl -pi -e 'print "\xEF\xBB\xBF" if $$. == 1 && !/^\xEF\xBB\xBF/' ./ScummVM-snapshot/doc/*/*
+else
xattr -w "com.apple.TextEncoding" "utf-8;134217984" ./ScummVM-snapshot/doc/*/*
endif
+ $(XCODETOOLSPATH)/SetFile -t ttro -c ttxt ./ScummVM-snapshot/doc/QuickStart
+ $(XCODETOOLSPATH)/SetFile -t ttro -c ttxt ./ScummVM-snapshot/doc/*/*
cp -RP $(bundle_name) ./ScummVM-snapshot/
cp $(srcdir)/dists/macosx/DS_Store ./ScummVM-snapshot/.DS_Store
cp $(srcdir)/dists/macosx/background.jpg ./ScummVM-snapshot/background.jpg
More information about the Scummvm-git-logs
mailing list