summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-21 21:30:17 +0000
committerrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-21 21:30:17 +0000
commit7316e3e557994729c709b2d227303183bd918569 (patch)
tree6e7dc7c4f8d9b683d43587120e435588e32b5676 /chrome
parent92c9707be15b60cb203313aeee0d03d6fd864421 (diff)
downloadchromium_src-7316e3e557994729c709b2d227303183bd918569.zip
chromium_src-7316e3e557994729c709b2d227303183bd918569.tar.gz
chromium_src-7316e3e557994729c709b2d227303183bd918569.tar.bz2
[Mac] Properly save the workarea when saving window positions.
BUG=none TEST=none Review URL: http://codereview.chromium.org/315002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29708 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm8
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
index c9edfab..be1d99f 100644
--- a/chrome/browser/cocoa/browser_window_controller.mm
+++ b/chrome/browser/cocoa/browser_window_controller.mm
@@ -1199,6 +1199,10 @@ willPositionSheet:(NSWindow*)sheet
gfx::Rect bounds(NSRectToCGRect([[self window] frame]));
bounds.set_y(monitorFrame.size.height - bounds.y() - bounds.height());
+ // We also need to save the current work area, in flipped coordinates.
+ gfx::Rect workArea(NSRectToCGRect([[[self window] screen] visibleFrame]));
+ workArea.set_y(monitorFrame.size.height - workArea.y() - workArea.height());
+
DictionaryValue* windowPreferences = prefs->GetMutableDictionary(
browser_->GetWindowPlacementKey().c_str());
windowPreferences->SetInteger(L"left", bounds.x());
@@ -1207,6 +1211,10 @@ willPositionSheet:(NSWindow*)sheet
windowPreferences->SetInteger(L"bottom", bounds.bottom());
windowPreferences->SetBoolean(L"maximized", false);
windowPreferences->SetBoolean(L"always_on_top", false);
+ windowPreferences->SetInteger(L"work_area_left", workArea.x());
+ windowPreferences->SetInteger(L"work_area_top", workArea.y());
+ windowPreferences->SetInteger(L"work_area_right", workArea.right());
+ windowPreferences->SetInteger(L"work_area_bottom", workArea.bottom());
}
- (NSRect)window:(NSWindow*)window