Skip to content

Commit

Permalink
Revert "Merge branch 'disableSetProcessName-feature' into tmp8"
Browse files Browse the repository at this point in the history
This reverts commit d8ee76d.
  • Loading branch information
danwalmsley committed Oct 27, 2022
1 parent d8ee76d commit a35520c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 27 deletions.
28 changes: 5 additions & 23 deletions native/Avalonia.Native/src/OSX/main.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "common.h"

static NSString* s_appTitle = @"Avalonia";
static int disableSetProcessName = 0;

// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
Expand Down Expand Up @@ -112,17 +111,11 @@ virtual HRESULT SetApplicationTitle(char* utf8String) override
@autoreleasepool
{
auto appTitle = [NSString stringWithUTF8String: utf8String];
if (disableSetProcessName == 0)
{
[[NSProcessInfo processInfo] setProcessName:appTitle];

SetProcessName(appTitle);
}
if (disableSetProcessName == 1)
{
auto rootMenu = [NSApp mainMenu];
[rootMenu setTitle:appTitle];
}

[[NSProcessInfo processInfo] setProcessName:appTitle];


SetProcessName(appTitle);

return S_OK;
}
Expand All @@ -140,17 +133,6 @@ virtual HRESULT SetShowInDock(int show) override
}
}

virtual HRESULT SetDisableSetProcessName(int disable) override
{
START_COM_CALL;

@autoreleasepool
{
disableSetProcessName = disable;
return S_OK;
}
}

};

/// See "Using POSIX Threads in a Cocoa Application" section here:
Expand Down
1 change: 0 additions & 1 deletion src/Avalonia.Native/AvaloniaNativePlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ void DoInitialize()
var macOpts = AvaloniaLocator.Current.GetService<MacOSPlatformOptions>() ?? new MacOSPlatformOptions();

_factory.MacOptions.SetShowInDock(macOpts.ShowInDock ? 1 : 0);
_factory.MacOptions.SetDisableSetProcessName(macOpts.DisableSetProcessName ? 1 : 0);
}

AvaloniaLocator.CurrentMutable
Expand Down
2 changes: 0 additions & 2 deletions src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,5 @@ public class MacOSPlatformOptions
/// Gets or sets a value indicating whether the native macOS menu bar will be enabled for the application.
/// </summary>
public bool DisableNativeMenus { get; set; }

public bool DisableSetProcessName { get; set; }
}
}
1 change: 0 additions & 1 deletion src/Avalonia.Native/avn.idl
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ interface IAvnMacOptions : IUnknown
{
HRESULT SetShowInDock(int show);
HRESULT SetApplicationTitle(char* utf8string);
HRESULT SetDisableSetProcessName(int disable);
}

[uuid(04c1b049-1f43-418a-9159-cae627ec1367)]
Expand Down

0 comments on commit a35520c

Please sign in to comment.