From 7316e3e557994729c709b2d227303183bd918569 Mon Sep 17 00:00:00 2001 From: "rohitrao@chromium.org" Date: Wed, 21 Oct 2009 21:30:17 +0000 Subject: [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 --- chrome/browser/cocoa/browser_window_controller.mm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'chrome') 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 -- cgit v1.1