summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/nswindow_additions.h
diff options
context:
space:
mode:
authorrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-21 16:15:49 +0000
committerrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-21 16:15:49 +0000
commitd65b735d987b4098074fecbd9fd910642457c3da (patch)
tree088823c90ed2d1205b5ac6d43e816edb92aeaeca /chrome/browser/cocoa/nswindow_additions.h
parentaf1654c383cddf88f5bcade6949f96a90c3f1790 (diff)
downloadchromium_src-d65b735d987b4098074fecbd9fd910642457c3da.zip
chromium_src-d65b735d987b4098074fecbd9fd910642457c3da.tar.gz
chromium_src-d65b735d987b4098074fecbd9fd910642457c3da.tar.bz2
[Mac] Explicitly set Space when existing full screen
If a user moves the full screen window to a different space they get snapped back to the original space when they exit full screen. The problem is that internally the full screen window is a different window than the normal browser window. This means that any changes the user makes to the full screen window aren't reflected on the normal browser window. The correct fix for this bug is to create a new browser window when the user exits full screen. This new window would then be on the correct space. This would require a fairly large architectural change to the BrowserWindowController class. My proposed fix is much simpler. When exiting full screen we simply move the normal browser window to the Space that the full screen window is on. Original review at: http://codereview.chromium.org/3345005/show Patch by Sailesh Agrawal <fnepal@gmail.com>. BUG=41693 TEST=Moved the full screen window to a different Space. Verified that exiting full screen didn't change the active Space. Review URL: http://codereview.chromium.org/3386015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60063 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/nswindow_additions.h')
-rw-r--r--chrome/browser/cocoa/nswindow_additions.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/nswindow_additions.h b/chrome/browser/cocoa/nswindow_additions.h
new file mode 100644
index 0000000..69ed983
--- /dev/null
+++ b/chrome/browser/cocoa/nswindow_additions.h
@@ -0,0 +1,25 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_COCOA_NSWINDOW_ADDITIONS_H_
+#define CHROME_BROWSER_COCOA_NSWINDOW_ADDITIONS_H_
+#pragma once
+
+#import <Cocoa/Cocoa.h>
+
+// ID of a Space. Starts at 1.
+typedef int CGSWorkspaceID;
+
+@interface NSWindow(ChromeAdditions)
+
+// Gets the Space that the window is currently on. YES on success, NO on
+// failure.
+- (BOOL)cr_workspace:(CGSWorkspaceID*)outWorkspace;
+
+// Moves the window to the given Space. YES on success, NO on failure.
+- (BOOL)cr_moveToWorkspace:(CGSWorkspaceID)workspace;
+
+@end
+
+#endif // CHROME_BROWSER_COCOA_NSWINDOW_ADDITIONS_H_