Bug 1630732 - Disable moving windows to a different space when the 'screensHaveSeparateSpaces' configuration option is set in Mission Control on Mac OSX. r=mstange
authorMike de Boer <mdeboer@mozilla.com>
Thu, 30 Apr 2020 16:40:11 +0000
changeset 594105 f44bb30dd8a2273a3d46ba1b9e5920cfbd4d52da
parent 594104 1e845a0c4c93814c9f07c2ed8905922bd8761e51
child 594106 54d5f4042cb1c53e456c76e29a2e127f74ffd8f8
push id2335
push userffxbld-merge
push dateMon, 25 May 2020 13:47:24 +0000
treeherdermozilla-release@69ca1d06f46a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1630732
milestone77.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1630732 - Disable moving windows to a different space when the 'screensHaveSeparateSpaces' configuration option is set in Mission Control on Mac OSX. r=mstange Differential Revision: https://phabricator.services.mozilla.com/D72169
widget/cocoa/nsCocoaWindow.mm
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -1315,16 +1315,22 @@ int32_t nsCocoaWindow::GetWorkspaceID() 
 
 void nsCocoaWindow::MoveToWorkspace(const nsAString& workspaceIDStr) {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   if (!nsCocoaFeatures::OnElCapitanOrLater()) {
     return;
   }
 
+  if ([NSScreen screensHaveSeparateSpaces] && [[NSScreen screens] count] > 1) {
+    // We don't support moving to a workspace when the user has this option
+    // enabled in Mission Control.
+    return;
+  }
+
   nsresult rv = NS_OK;
   int32_t workspaceID = workspaceIDStr.ToInteger(&rv);
   if (NS_FAILED(rv)) {
     return;
   }
 
   CGSConnection cid = _CGSDefaultConnection();
   int32_t currentSpace = GetWorkspaceID();