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

Unified Diff: ash/wm/dock/docked_window_resizer.cc

Issue 19054013: Implement automatic layout and stacking for docked windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_233331_sized
Patch Set: Implement automatic layout and stacking (published a flag) Created 7 years, 5 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
Index: ash/wm/dock/docked_window_resizer.cc
diff --git a/ash/wm/dock/docked_window_resizer.cc b/ash/wm/dock/docked_window_resizer.cc
index fc880d76a27dab0e94a0a3be2223706220a47f54..224adb641530c2923616fa990c91b887d07af25a 100644
--- a/ash/wm/dock/docked_window_resizer.cc
+++ b/ash/wm/dock/docked_window_resizer.cc
@@ -174,7 +174,7 @@ bool DockedWindowResizer::MaybeSnapToEdge(const gfx::Rect& bounds,
(dock_alignment == internal::DOCKED_ALIGNMENT_NONE && was_docked_)) {
const int distance = bounds.x() - dock_bounds.x();
if (distance < kSnapToDockDistance && distance > -kStickyDistance) {
- offset->set_x(dock_bounds.x() - bounds.x());
+ offset->set_x(-distance);
return true;
}
}
@@ -182,7 +182,7 @@ bool DockedWindowResizer::MaybeSnapToEdge(const gfx::Rect& bounds,
(dock_alignment == internal::DOCKED_ALIGNMENT_NONE && was_docked_)) {
const int distance = dock_bounds.right() - bounds.right();
if (distance < kSnapToDockDistance && distance > -kStickyDistance) {
- offset->set_x(dock_bounds.right() - bounds.right());
+ offset->set_x(distance);
return true;
}
}
@@ -213,6 +213,10 @@ void DockedWindowResizer::FinishDragging() {
if (should_dock !=
(window->parent()->id() == internal::kShellWindowId_DockedContainer)) {
if (should_dock) {
+ // Panel resizer might have attached this to the launcher.
+ // Docked resizer takes priority and may attach it to the docked area.
+ if (window->type() == aura::client::WINDOW_TYPE_PANEL)
+ window->SetProperty(internal::kPanelAttachedKey, false);
flackr 2013/07/16 22:05:45 Separate CL please.
varkha 2013/07/18 21:56:59 Done.
aura::Window* dock_container = Shell::GetContainer(
window->GetRootWindow(),
internal::kShellWindowId_DockedContainer);

Powered by Google App Engine
This is Rietveld 408576698