From 1d59a62944ec1fe59423958da15c643470928309 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Mon, 31 Jul 2023 11:50:50 -0400 Subject: [PATCH] Ladybird: Remove macOS workaround for WebContent GUI interaction This reverts commit 4dcdc3bd25def54d5411e34aa1da7ead3ef6c3eb. Now that WebContent is a QCoreApplication, this workaround is no longer needed. --- Ladybird/WebContent/CMakeLists.txt | 4 ---- Ladybird/WebContent/MacOSSetup.h | 9 --------- Ladybird/WebContent/MacOSSetup.mm | 15 --------------- Ladybird/WebContent/main.cpp | 9 --------- 4 files changed, 37 deletions(-) delete mode 100644 Ladybird/WebContent/MacOSSetup.h delete mode 100644 Ladybird/WebContent/MacOSSetup.mm diff --git a/Ladybird/WebContent/CMakeLists.txt b/Ladybird/WebContent/CMakeLists.txt index 494ba3b550..a4e499bce4 100644 --- a/Ladybird/WebContent/CMakeLists.txt +++ b/Ladybird/WebContent/CMakeLists.txt @@ -19,10 +19,6 @@ set(WEBCONTENT_SOURCES main.cpp ) -if (APPLE) - list(APPEND WEBCONTENT_SOURCES MacOSSetup.mm) -endif() - qt_add_executable(WebContent ${WEBCONTENT_SOURCES}) target_include_directories(WebContent PRIVATE ${SERENITY_SOURCE_DIR}/Userland/Services/) diff --git a/Ladybird/WebContent/MacOSSetup.h b/Ladybird/WebContent/MacOSSetup.h deleted file mode 100644 index 6125379158..0000000000 --- a/Ladybird/WebContent/MacOSSetup.h +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2023, Tim Flynn - * - * SPDX-License-Identifier: BSD-2-Clause - */ - -#pragma once - -void prohibit_interaction(); diff --git a/Ladybird/WebContent/MacOSSetup.mm b/Ladybird/WebContent/MacOSSetup.mm deleted file mode 100644 index e323c58adf..0000000000 --- a/Ladybird/WebContent/MacOSSetup.mm +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2023, Tim Flynn - * - * SPDX-License-Identifier: BSD-2-Clause - */ - -#include "MacOSSetup.h" -#import - -void prohibit_interaction() -{ - // This prevents WebContent from being displayed in the macOS Dock and becoming the focused, - // interactable application upon launch. - [NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited]; -} diff --git a/Ladybird/WebContent/main.cpp b/Ladybird/WebContent/main.cpp index c084cf799e..f52cd754d5 100644 --- a/Ladybird/WebContent/main.cpp +++ b/Ladybird/WebContent/main.cpp @@ -12,7 +12,6 @@ #include "../Utilities.h" #include "../WebSocketClientManagerLadybird.h" #include -#include #include #include #include @@ -35,10 +34,6 @@ #include #include -#if defined(AK_OS_MACOS) -# include "MacOSSetup.h" -#endif - static ErrorOr load_content_filters(); static ErrorOr load_autoplay_allowlist(); @@ -48,10 +43,6 @@ ErrorOr serenity_main(Main::Arguments arguments) { QCoreApplication app(arguments.argc, arguments.argv); -#if defined(AK_OS_MACOS) - prohibit_interaction(); -#endif - Core::EventLoopManager::install(*new Ladybird::EventLoopManagerQt); Core::EventLoop event_loop;