fix: set application policy on macOS for extension (#6043)
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@
|
||||
- Minor: Added Linux support for Live Notifications toasts. (#5881, #5971, #5976)
|
||||
- Minor: Messages can now be deleted from the context menu in a channel. (#5956)
|
||||
- Minor: Overlay windows now inherit the global zoom level and can be zoomed independently. (#6016)
|
||||
- Minor: The `/watching` channel is now supported on all platforms. (#6031)
|
||||
- Minor: The `/watching` channel is now supported on all platforms. (#6031, #6043)
|
||||
- Minor: The font weight of chat messages can now be changed. (#6037)
|
||||
- Minor: Messages from suspicious users can now be hidden when in streamer mode. This is enabled by default. (#6042)
|
||||
- Bugfix: Fixed a potential way to escape the Lua Plugin sandbox. (#5846)
|
||||
|
||||
@@ -765,6 +765,8 @@ if (APPLE)
|
||||
set(MACOS_BUNDLE_ICON_FILE "${CMAKE_SOURCE_DIR}/resources/chatterino.icns")
|
||||
list(APPEND SOURCE_FILES "${MACOS_BUNDLE_ICON_FILE}")
|
||||
set_source_files_properties(${MACOS_BUNDLE_ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
||||
|
||||
list(APPEND SOURCE_FILES util/MacOsHelpers.mm)
|
||||
endif ()
|
||||
|
||||
# Generate source groups for use in IDEs
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
#include "util/AttachToConsole.hpp"
|
||||
#include "util/IpcQueue.hpp"
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
# include "util/MacOsHelpers.h"
|
||||
#endif
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QMessageBox>
|
||||
@@ -73,6 +77,9 @@ int main(int argc, char **argv)
|
||||
// run in gui mode or browser extension host mode
|
||||
if (args.shouldRunBrowserExtensionHost)
|
||||
{
|
||||
#ifdef Q_OS_MACOS
|
||||
::chatterinoSetMacOsActivationPolicyProhibited();
|
||||
#endif
|
||||
runBrowserExtensionHost();
|
||||
}
|
||||
else if (args.printVersion)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
void chatterinoSetMacOsActivationPolicyProhibited();
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "util/MacOsHelpers.h"
|
||||
|
||||
#include <AppKit/AppKit.h>
|
||||
|
||||
void chatterinoSetMacOsActivationPolicyProhibited()
|
||||
{
|
||||
[[NSApplication sharedApplication] setActivationPolicy:NSApplicationActivationPolicyProhibited];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user