Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(600)

Unified Diff: ui/aura_shell/workspace/workspace.cc

Issue 8400067: Fixes bug where windows weren't being moved and resized if the desktop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge and incorporate feedback Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura_shell/workspace/workspace.h ('k') | ui/aura_shell/workspace/workspace_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/workspace/workspace.cc
diff --git a/ui/aura_shell/workspace/workspace.cc b/ui/aura_shell/workspace/workspace.cc
index f661e9279858db52ccc645ea7ab020850e66092e..083644d194299377ae1e2f488fe106a87d83d656 100644
--- a/ui/aura_shell/workspace/workspace.cc
+++ b/ui/aura_shell/workspace/workspace.cc
@@ -4,6 +4,8 @@
#include "ui/aura_shell/workspace/workspace.h"
+#include <algorithm>
+
#include "base/logging.h"
#include "ui/aura/desktop.h"
#include "ui/aura/window.h"
@@ -20,6 +22,7 @@ size_t g_max_windows_per_workspace = 2;
}
namespace aura_shell {
+namespace internal {
Workspace::Workspace(WorkspaceManager* manager)
: workspace_manager_(manager) {
@@ -211,7 +214,11 @@ void Workspace::MoveWindowTo(
window->Maximize();
else {
gfx::Rect bounds = window->GetTargetBounds();
- bounds.set_origin(origin);
+ gfx::Rect work_area = GetWorkAreaBounds();
+ // Make sure the window isn't bigger than the workspace size.
+ bounds.SetRect(origin.x(), origin.y(),
+ std::min(work_area.width(), bounds.width()),
+ std::min(work_area.height(), bounds.height()));
if (animate) {
ui::LayerAnimator::ScopedSettings settings(
window->layer()->GetAnimator());
@@ -242,4 +249,5 @@ size_t Workspace::SetMaxWindowsCount(size_t max) {
return old;
}
+} // namespace internal
} // namespace aura_shell
« no previous file with comments | « ui/aura_shell/workspace/workspace.h ('k') | ui/aura_shell/workspace/workspace_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698