ladybird/Ladybird/WebContent/MacOSSetup.mm
Timothy Flynn 4dcdc3bd25 Ladybird: Prohibit GUI interaction of the WebContent process on macOS
The WebContent process behaves a bit awkwardly on macOS. When we launch
the process, we have to create a QGuiApplication to access system fonts.
But on macOS, doing so creates an entry in the Dock, and also causes the
WebContent to be focused. So if you enter cmd+Q without first focusing
the Ladybird GUI, WebContent is closed, while the Ladybird process keeps
running.
2023-04-27 07:26:05 +02:00

15 lines
417 B
Text

/*
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "MacOSSetup.h"
#import <AppKit/NSApplication.h>
void prohibit_interaction()
{
// This prevents WebContent from being displayed in the macOS Dock and becoming the focused,
// interactable application upon launch.
[NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited];
}