From d0fb4c563f8fe9d995cdcaec7b2b16e77e19d1a2 Mon Sep 17 00:00:00 2001 From: Andrew De Ponte Date: Wed, 13 Dec 2017 13:30:27 -0800 Subject: [PATCH] On macOS when launching multiple times focus win (#941) I dug into this and narrowed the issue down to the macOS app bundle Info.plist file. So, I spun up a native macOS app real quick and tested it by launching the binary directly and launching it via the app bundle. When launching from the command line directly, it created multiple windows & instances of the app. However, when launching via the app bundle it behaved as I normally expect a macOS app to behave, that is when launched multiple times to simply focus the already existing window and instance. This informed me that it wasn't something in code as much as it was something in the app bundle configuration. Hence, I reworked the Info.plist file based on the one that was created by XCode when I made the native macOS app and it started behaving as expected. --- assets/osx/Alacritty.app/Contents/Info.plist | 58 +++++++++++--------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/assets/osx/Alacritty.app/Contents/Info.plist b/assets/osx/Alacritty.app/Contents/Info.plist index 9016ca4d..3aa2f703 100644 --- a/assets/osx/Alacritty.app/Contents/Info.plist +++ b/assets/osx/Alacritty.app/Contents/Info.plist @@ -1,32 +1,36 @@ - + - CFBundleDisplayName - Alacritty - CFBundleExecutable - alacritty - CFBundleIdentifier - io.alacritty - CFBundleName - Alacritty - CFBundleIconFile - alacritty.icns - CFBundleShortVersionString - 0.1.0 - CFBundleVersion - 0.1.0 - CFBundleDevelopmentRegion - en - CFBundlePackageType - APPL - CFBundleInfoDictionaryVersion - 6.0 - NSHighResolutionCapable - - NSMainNibFile - - NSSupportsAutomaticGraphicsSwitching - + CFBundleDevelopmentRegion + en + CFBundleExecutable + alacritty + CFBundleIdentifier + io.alacritty + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Alacritty + CFBundlePackageType + APPL + CFBundleShortVersionString + 0.1.0 + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1 + CFBundleIconFile + alacritty.icns + NSHighResolutionCapable + + NSMainNibFile + + NSSupportsAutomaticGraphicsSwitching + + CFBundleDisplayName + Alacritty