diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index 06373b690cda..7cfff3bc0a20 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -1619,7 +1619,8 @@ GetDirectoryPath(const char *aPath) { #endif // DEBUG extern "C" { -void CGSSetDenyWindowServerConnections(bool); +CGError +CGSSetDenyWindowServerConnections(bool); void CGSShutdownServerConnections(); }; @@ -1631,13 +1632,15 @@ StartMacOSContentSandbox() return false; } - if (!XRE_UseNativeEventProcessing()) { + if (Preferences::GetBool( + "security.sandbox.content.mac.disconnect-windowserver")) { // If we've opened a connection to the window server, shut it down now. Forbid // future connections as well. We do this for sandboxing, but it also ensures // that the Activity Monitor will not label the content process as "Not // responding" because it's not running a native event loop. See bug 1384336. - CGSSetDenyWindowServerConnections(true); CGSShutdownServerConnections(); + CGError result = CGSSetDenyWindowServerConnections(true); + MOZ_DIAGNOSTIC_ASSERT(result == kCGErrorSuccess); } nsAutoCString appPath, appBinaryPath, appDir; diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 14c3c42af7d3..3457ed525159 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -3254,7 +3254,7 @@ pref("dom.ipc.processCount.privileged", 1); pref("dom.ipc.keepProcessesAlive.privileged", 1); // Whether a native event loop should be used in the content process. -#if defined(XP_WIN) +#if defined(XP_WIN) || defined(XP_MACOSX) pref("dom.ipc.useNativeEventProcessing.content", false); #else pref("dom.ipc.useNativeEventProcessing.content", true);