Repository navigation
Labels
Description
Electron 44 will remove support for macOS 12.
Login items use a new macOS API on macOS 13+ and an old one on macOS 12 and below.
Because we no longer support macOS 12, we can remove the code that uses the old API.
This is where it is implemented:
electron/shell/browser/browser_mac.mm
Lines 458 to 479 in 97af1d3
| if (@available(macOS 13, *)) { | |
| // If the app was previously set as a LoginItem with the old API, remove it | |
| // as a LoginItem via the old API before re-enabling with the new API. | |
| const std::string status = | |
| platform_util::GetLoginItemEnabled("mainAppService", ""); | |
| if (status == "enabled-deprecated") { | |
| base::mac::RemoveFromLoginItems(bundle_path); | |
| if (settings.open_at_login) { | |
| platform_util::SetLoginItemEnabled(settings.type, settings.service_name, | |
| settings.open_at_login); | |
| } | |
| } else { | |
| platform_util::SetLoginItemEnabled(settings.type, settings.service_name, | |
| settings.open_at_login); | |
| } | |
| } else { | |
| if (settings.open_at_login) { | |
| base::mac::AddToLoginItems(bundle_path, settings.open_as_hidden); | |
| } else { | |
| base::mac::RemoveFromLoginItems(bundle_path); | |
| } | |
| } |
Activity