From 058ebe582bc78273e6b2cf74f503e98e85d93187 Mon Sep 17 00:00:00 2001 From: avelytchko <919635+avelytchko@users.noreply.github.com> Date: Thu, 29 Jan 2026 16:14:58 +0100 Subject: [PATCH 1/5] CI: Use macos sdk 12.3 --- .github/workflows/build_foobar.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_foobar.yml b/.github/workflows/build_foobar.yml index d44b2ba..f9d6636 100644 --- a/.github/workflows/build_foobar.yml +++ b/.github/workflows/build_foobar.yml @@ -77,6 +77,7 @@ jobs: xcodebuild -project foo_mac_scrobble.xcodeproj \ -scheme foo_mac_scrobble \ -configuration Release \ + -sdk macosx12.3 \ ARCHS="arm64 x86_64" \ VALID_ARCHS="arm64 x86_64" \ ONLY_ACTIVE_ARCH=NO \ From 74d7037d47358f9a689c566d79e2d2b173bd4abb Mon Sep 17 00:00:00 2001 From: avelytchko <919635+avelytchko@users.noreply.github.com> Date: Thu, 29 Jan 2026 16:19:19 +0100 Subject: [PATCH 2/5] CI: Check avail SDKs --- .github/workflows/build_foobar.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_foobar.yml b/.github/workflows/build_foobar.yml index f9d6636..715fd3a 100644 --- a/.github/workflows/build_foobar.yml +++ b/.github/workflows/build_foobar.yml @@ -74,10 +74,15 @@ jobs: echo "::group::🧩 Xcode Build" mkdir -p build set -o pipefail + + # Check available SDKs + echo "Available SDKs:" + xcodebuild -showsdks | grep macosx + + # Use latest available SDK but with deployment target 12.0 xcodebuild -project foo_mac_scrobble.xcodeproj \ -scheme foo_mac_scrobble \ -configuration Release \ - -sdk macosx12.3 \ ARCHS="arm64 x86_64" \ VALID_ARCHS="arm64 x86_64" \ ONLY_ACTIVE_ARCH=NO \ From 6f44b6b32f2e2b4dae3d7ac7056cfeee1e73428e Mon Sep 17 00:00:00 2001 From: avelytchko <919635+avelytchko@users.noreply.github.com> Date: Thu, 29 Jan 2026 16:25:34 +0100 Subject: [PATCH 3/5] CI: Add backward compat compile flags --- .github/workflows/build_foobar.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_foobar.yml b/.github/workflows/build_foobar.yml index 715fd3a..4440786 100644 --- a/.github/workflows/build_foobar.yml +++ b/.github/workflows/build_foobar.yml @@ -79,7 +79,7 @@ jobs: echo "Available SDKs:" xcodebuild -showsdks | grep macosx - # Use latest available SDK but with deployment target 12.0 + # Use latest available SDK but with deployment target 12.0 and compatibility flags xcodebuild -project foo_mac_scrobble.xcodeproj \ -scheme foo_mac_scrobble \ -configuration Release \ @@ -90,7 +90,9 @@ jobs: -derivedDataPath build \ OTHER_CPLUSPLUSFLAGS="-DFOO_LASTFM_DEBUG_DEFAULT=1 \ -DFOO_LASTFM_CI_API_KEY='\"${{ secrets.LASTFM_API_KEY }}\"' \ - -DFOO_LASTFM_CI_API_SECRET='\"${{ secrets.LASTFM_API_SECRET }}\"'" \ + -DFOO_LASTFM_CI_API_SECRET='\"${{ secrets.LASTFM_API_SECRET }}\"' \ + -mmacosx-version-min=12.0 \ + -Wno-unguarded-availability-new" \ > build/build.log 2>&1 | xcpretty --color --simple echo "::endgroup::" From 73bc36e460d0b40c95b68ce95e33a783e4d02244 Mon Sep 17 00:00:00 2001 From: avelytchko <919635+avelytchko@users.noreply.github.com> Date: Thu, 29 Jan 2026 18:13:07 +0100 Subject: [PATCH 4/5] fix: resolve preferences UI compatibility issues on macOS Monterey - Fix blank preferences page on macOS 12 by implementing manual view creation - Replace problematic [super loadView] with custom NSView instantiation - Add comprehensive debug logging for UI lifecycle troubleshooting - Maintain backward compatibility with macOS 12+ while preserving functionality on newer versions - Remove translatesAutoresizingMaskIntoConstraints from main view to prevent positioning issues Fixes #6 --- .github/workflows/build_foobar.yml | 11 +-- .../Mac/fooLastfmMacPreferences.mm | 90 ++++++++++++++++++- 2 files changed, 88 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_foobar.yml b/.github/workflows/build_foobar.yml index 4440786..62d4d89 100644 --- a/.github/workflows/build_foobar.yml +++ b/.github/workflows/build_foobar.yml @@ -74,25 +74,16 @@ jobs: echo "::group::🧩 Xcode Build" mkdir -p build set -o pipefail - - # Check available SDKs - echo "Available SDKs:" - xcodebuild -showsdks | grep macosx - - # Use latest available SDK but with deployment target 12.0 and compatibility flags xcodebuild -project foo_mac_scrobble.xcodeproj \ -scheme foo_mac_scrobble \ -configuration Release \ ARCHS="arm64 x86_64" \ VALID_ARCHS="arm64 x86_64" \ ONLY_ACTIVE_ARCH=NO \ - MACOSX_DEPLOYMENT_TARGET=12.0 \ -derivedDataPath build \ OTHER_CPLUSPLUSFLAGS="-DFOO_LASTFM_DEBUG_DEFAULT=1 \ -DFOO_LASTFM_CI_API_KEY='\"${{ secrets.LASTFM_API_KEY }}\"' \ - -DFOO_LASTFM_CI_API_SECRET='\"${{ secrets.LASTFM_API_SECRET }}\"' \ - -mmacosx-version-min=12.0 \ - -Wno-unguarded-availability-new" \ + -DFOO_LASTFM_CI_API_SECRET='\"${{ secrets.LASTFM_API_SECRET }}\"'" \ > build/build.log 2>&1 | xcpretty --color --simple echo "::endgroup::" diff --git a/foobar2000/foo_mac_scrobble/Mac/fooLastfmMacPreferences.mm b/foobar2000/foo_mac_scrobble/Mac/fooLastfmMacPreferences.mm index ec1b47f..8f99338 100644 --- a/foobar2000/foo_mac_scrobble/Mac/fooLastfmMacPreferences.mm +++ b/foobar2000/foo_mac_scrobble/Mac/fooLastfmMacPreferences.mm @@ -32,14 +32,56 @@ @interface fooLastfmMacPreferences () @implementation fooLastfmMacPreferences +- (instancetype)init { + self = [super init]; + if (self) { + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: fooLastfmMacPreferences init called"; + } + } + return self; +} + +- (void)loadView { + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: loadView called"; + } + + // Create view manually for macOS 12 compatibility + NSView* mainView = [[NSView alloc] init]; + // Don't set translatesAutoresizingMaskIntoConstraints:NO for main view + self.view = mainView; + + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: loadView completed"; + } +} + - (void)viewDidLoad { [super viewDidLoad]; + + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: viewDidLoad called"; + FB2K_console_formatter() << "Last.fm UI: macOS version: " << [[NSProcessInfo processInfo].operatingSystemVersionString UTF8String]; + FB2K_console_formatter() << "Last.fm UI: view frame: " << NSStringFromRect(self.view.frame).UTF8String; + } + [self setupUI]; showingSecrets = NO; + + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: viewDidLoad completed"; + } } - (void)viewWillAppear { [super viewWillAppear]; + + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: viewWillAppear called"; + FB2K_console_formatter() << "Last.fm UI: view bounds: " << NSStringFromRect(self.view.bounds).UTF8String; + FB2K_console_formatter() << "Last.fm UI: view subviews count: " << (int)self.view.subviews.count; + } // Load current settings from configuration realApiKey = foo_lastfm::cfg_api_key.get(); @@ -65,21 +107,41 @@ - (void)viewWillAppear { } - (void)setupUI { + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: setupUI started"; + } + // Create main stack view for organizing UI elements NSStackView* stackView = [[NSStackView alloc] init]; + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: NSStackView created"; + } + [stackView setOrientation:NSUserInterfaceLayoutOrientationVertical]; [stackView setAlignment:NSLayoutAttributeLeading]; [stackView setSpacing:8]; [stackView setTranslatesAutoresizingMaskIntoConstraints:NO]; + + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: NSStackView configured"; + } + [self.view addSubview:stackView]; + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: NSStackView added to view"; + } - // Set standard system margins - CGFloat inset = 19.0; // Adjustable margin size + // Set standard margins + CGFloat inset = 19.0; [stackView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor constant:inset].active = YES; [stackView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor constant:-inset].active = YES; [stackView.topAnchor constraintEqualToAnchor:self.view.topAnchor constant:inset].active = YES; [stackView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor constant:-inset].active = YES; + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: NSStackView constraints set"; + } + // Add title label NSTextField* titleLabel = [[NSTextField alloc] init]; [titleLabel setStringValue:@"Last.fm Scrobbler Settings"]; @@ -88,6 +150,11 @@ - (void)setupUI { [titleLabel setEditable:NO]; [titleLabel setFont:[NSFont systemFontOfSize:15]]; [stackView addArrangedSubview:titleLabel]; + + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: Title label added"; + FB2K_console_formatter() << "Last.fm UI: StackView arranged subviews count: " << (int)stackView.arrangedSubviews.count; + } // Add spacer NSView* spacer1 = [[NSView alloc] init]; @@ -221,6 +288,12 @@ - (void)setupUI { // Update status label after UI setup [self updateStatusLabel]; + + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: setupUI completed"; + FB2K_console_formatter() << "Last.fm UI: Final stackView subviews count: " << (int)stackView.arrangedSubviews.count; + FB2K_console_formatter() << "Last.fm UI: View hierarchy ready"; + } } - (void)updateStatusLabel { @@ -620,7 +693,18 @@ - (IBAction)onAuthenticateClicked:(id)sender { class preferences_page_lastfm : public preferences_page { public: service_ptr instantiate() override { - return fb2k::wrapNSObject([fooLastfmMacPreferences new]); + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: preferences_page instantiate() called"; + } + auto controller = [fooLastfmMacPreferences new]; + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: fooLastfmMacPreferences controller created"; + } + auto wrapped = fb2k::wrapNSObject(controller); + if (foo_lastfm::cfg_debug_enabled.get()) { + FB2K_console_formatter() << "Last.fm UI: NSObject wrapped for foobar2000"; + } + return wrapped; } const char* get_name() override { return "Last.fm Scrobbler"; } GUID get_guid() override { From 0d014bb71e0eef4b16378aa4214a571ff8df29d5 Mon Sep 17 00:00:00 2001 From: avelytchko <919635+avelytchko@users.noreply.github.com> Date: Thu, 29 Jan 2026 18:59:30 +0100 Subject: [PATCH 5/5] Bump to version 0.1.4 --- .github/ISSUE_TEMPLATE/bug_report.yml | 3 ++- .../rand.xcuserdatad/xcschemes/xcschememanagement.plist | 2 +- .../foo_mac_scrobble.xcodeproj/project.pbxproj | 4 ++-- foobar2000/foo_mac_scrobble/lastfm_api.cpp | 4 ++-- foobar2000/foo_mac_scrobble/main.cpp | 2 +- .../rand.xcuserdatad/xcschemes/xcschememanagement.plist | 2 +- .../rand.xcuserdatad/xcschemes/xcschememanagement.plist | 4 ++-- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index c584d70..bd305d3 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -13,7 +13,7 @@ body: attributes: label: Component Version description: Which version of foo_mac_scrobble are you using? - placeholder: e.g., 0.1.3 + placeholder: e.g., 0.1.4 validations: required: true @@ -36,6 +36,7 @@ body: - macOS Sequoia (15.x) - macOS Sonoma (14.x) - macOS Ventura (13.x) + - macOS Monterey (12.x) - Other (specify in description) validations: required: true diff --git a/foobar2000/SDK/foobar2000_SDK.xcodeproj/xcuserdata/rand.xcuserdatad/xcschemes/xcschememanagement.plist b/foobar2000/SDK/foobar2000_SDK.xcodeproj/xcuserdata/rand.xcuserdatad/xcschemes/xcschememanagement.plist index ac36bfb..3ab0a65 100644 --- a/foobar2000/SDK/foobar2000_SDK.xcodeproj/xcuserdata/rand.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/foobar2000/SDK/foobar2000_SDK.xcodeproj/xcuserdata/rand.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,7 @@ foobar2000_SDK.xcscheme_^#shared#^_ orderHint - 1 + 2 diff --git a/foobar2000/foo_mac_scrobble/foo_mac_scrobble.xcodeproj/project.pbxproj b/foobar2000/foo_mac_scrobble/foo_mac_scrobble.xcodeproj/project.pbxproj index 9b7b281..41bdb27 100644 --- a/foobar2000/foo_mac_scrobble/foo_mac_scrobble.xcodeproj/project.pbxproj +++ b/foobar2000/foo_mac_scrobble/foo_mac_scrobble.xcodeproj/project.pbxproj @@ -535,7 +535,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; LIBRARY_SEARCH_PATHS = "$(inherited)"; MACOSX_DEPLOYMENT_TARGET = 15.6; - MARKETING_VERSION = 0.1.3; + MARKETING_VERSION = 0.1.4; OTHER_LDFLAGS = "-lcurl"; PRODUCT_BUNDLE_IDENTIFIER = "com.foobar2000.foo-mac-scrobble"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -565,7 +565,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; LIBRARY_SEARCH_PATHS = "$(inherited)"; MACOSX_DEPLOYMENT_TARGET = 15.6; - MARKETING_VERSION = 0.1.3; + MARKETING_VERSION = 0.1.4; OTHER_LDFLAGS = "-lcurl"; PRODUCT_BUNDLE_IDENTIFIER = "com.foobar2000.foo-mac-scrobble"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/foobar2000/foo_mac_scrobble/lastfm_api.cpp b/foobar2000/foo_mac_scrobble/lastfm_api.cpp index e0b7cbe..8783231 100644 --- a/foobar2000/foo_mac_scrobble/lastfm_api.cpp +++ b/foobar2000/foo_mac_scrobble/lastfm_api.cpp @@ -347,7 +347,7 @@ bool LastfmApi::send_api_request(const std::map& param curl_easy_setopt(curl, CURLOPT_TIMEOUT, 15L); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 5L); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 0L); - curl_easy_setopt(curl, CURLOPT_USERAGENT, "foo_mac_scrobble/0.1.3 (macOS)"); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "foo_mac_scrobble/0.1.4 (macOS)"); curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, ""); // Log request details for debugging @@ -364,7 +364,7 @@ bool LastfmApi::send_api_request(const std::map& param FB2K_console_formatter() << "CURLOPT_TIMEOUT: 15"; FB2K_console_formatter() << "CURLOPT_CONNECTTIMEOUT: 5"; FB2K_console_formatter() << "CURLOPT_FOLLOWLOCATION: 0"; - FB2K_console_formatter() << "CURLOPT_USERAGENT: foo_mac_scrobble/0.1.3 (macOS)"; + FB2K_console_formatter() << "CURLOPT_USERAGENT: foo_mac_scrobble/0.1.4 (macOS)"; FB2K_console_formatter() << "CURLOPT_ACCEPT_ENCODING: "; FB2K_console_formatter() << "Post data length: " << (int)post_data.size(); FB2K_console_formatter() << "----------------------------"; diff --git a/foobar2000/foo_mac_scrobble/main.cpp b/foobar2000/foo_mac_scrobble/main.cpp index 42dabb4..03b428b 100644 --- a/foobar2000/foo_mac_scrobble/main.cpp +++ b/foobar2000/foo_mac_scrobble/main.cpp @@ -7,7 +7,7 @@ // update finder to find updates; for that to work, you must have ONLY ONE declaration per DLL. If there are multiple // declarations, the component is assumed to be outdated and a version number of "0" is assumed, to overwrite the // component with whatever is currently on the site assuming that it comes with proper version numbers. -DECLARE_COMPONENT_VERSION("Last.fm Scrobbler", "0.1.3", +DECLARE_COMPONENT_VERSION("Last.fm Scrobbler", "0.1.4", "Last.fm scrobbler for foobar2000 on macOS\n" "\n" "Automatically scrobbles tracks to Last.fm\n" diff --git a/foobar2000/foobar2000_component_client/foobar2000_component_client.xcodeproj/xcuserdata/rand.xcuserdatad/xcschemes/xcschememanagement.plist b/foobar2000/foobar2000_component_client/foobar2000_component_client.xcodeproj/xcuserdata/rand.xcuserdatad/xcschemes/xcschememanagement.plist index fca180d..fdb02ac 100644 --- a/foobar2000/foobar2000_component_client/foobar2000_component_client.xcodeproj/xcuserdata/rand.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/foobar2000/foobar2000_component_client/foobar2000_component_client.xcodeproj/xcuserdata/rand.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,7 @@ foobar2000_component_client.xcscheme_^#shared#^_ orderHint - 3 + 1 diff --git a/pfc/pfc.xcodeproj/xcuserdata/rand.xcuserdatad/xcschemes/xcschememanagement.plist b/pfc/pfc.xcodeproj/xcuserdata/rand.xcuserdatad/xcschemes/xcschememanagement.plist index f67e5e2..73bb534 100644 --- a/pfc/pfc.xcodeproj/xcuserdata/rand.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/pfc/pfc.xcodeproj/xcuserdata/rand.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,12 +7,12 @@ pfc-Mac.xcscheme_^#shared#^_ orderHint - 5 + 3 pfc-iOS.xcscheme_^#shared#^_ orderHint - 2 + 5