mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 17:40:27 +00:00
4dcdc3bd25
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.
15 lines
417 B
Text
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];
|
|
}
|