Skip to content

Commit 4fe1531

Browse files
aamCommit Queue
authored andcommitted
[vm/mac] Hide application icon from the dock.
TEST=Passing any value other than true as an argument brings the icon to the dock. BUG=flutter/flutter#170633 Change-Id: Ief117a0c95df3762cf1e54bc3facde8c92f7379b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437781 Reviewed-by: Slava Egorov <[email protected]> Commit-Queue: Alexander Aprelev <[email protected]>
1 parent af6fe80 commit 4fe1531

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

runtime/bin/platform_macos.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,14 @@ void Platform::SetProcessName(const char* name) {
349349

350350
_LSSetApplicationLaunchServicesServerConnectionStatus(0, nullptr);
351351

352-
_LSApplicationCheckIn(-2, CFBundleGetInfoDictionary(CFBundleGetMainBundle()));
352+
CFMutableDictionaryRef dictionary = CFDictionaryCreateMutableCopy(
353+
kCFAllocatorDefault, /*capacity=*/0,
354+
CFBundleGetInfoDictionary(CFBundleGetMainBundle()));
355+
if (dictionary == nullptr) return;
356+
ScopedCFStringRef _kLSUIElement("LSUIElement");
357+
CFDictionarySetValue(dictionary, _kLSUIElement.get(), kCFBooleanTrue);
358+
_LSApplicationCheckIn(-2, dictionary);
359+
CFRelease(dictionary);
353360

354361
CFTypeRef asn;
355362
asn = _LSGetCurrentApplicationASN();

0 commit comments

Comments
 (0)