Skip to content

Commit

Permalink
gui, feat: for darwin, don't display fibjs in dock by default, neithe…
Browse files Browse the repository at this point in the history
…r no menubar.
  • Loading branch information
richardo2016 committed Jul 18, 2020
1 parent 63b20f7 commit 8901d43
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fibjs/src/gui/darwin/WebView.mm
Expand Up @@ -53,8 +53,14 @@ void putGuiPool(AsyncEvent* ac)

result_t asyncFinishedLaunchingApp(NSApplication* app)
{
[app setActivationPolicy:NSApplicationActivationPolicyRegular];
[app activateIgnoringOtherApps:YES];
/**
* @see https://developer.apple.com/documentation/appkit/nsapplicationactivationpolicy/nsapplicationactivationpolicyregular?language=objc
*
* @enum NSApplicationActivationPolicyRegular default, can be overrided by Info.plist
* @enum NSApplicationActivationPolicyAccessory The application doesn’t appear in the Dock and doesn’t have a menu bar, but it may be activated programmatically or by clicking on one of its windows.
* @enum NSApplicationActivationPolicyProhibited The application doesn’t appear in the Dock and may not create windows or be activated.
*/
[app setActivationPolicy: NSApplicationActivationPolicyAccessory];
[app finishLaunching];

return 0;
Expand Down

0 comments on commit 8901d43

Please sign in to comment.