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

Unified Diff: ash/wm/base_layout_manager.cc

Issue 13896026: Stick windows to sides of workspaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Correcting logic to avoid getting stuck on resize Created 7 years, 7 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/base_layout_manager.cc
diff --git a/ash/wm/base_layout_manager.cc b/ash/wm/base_layout_manager.cc
index 89e99d9371250ef74893efc901e5b55046f18a97..6d87b2686df4b3d84c6458268a1612792f77cdd3 100644
--- a/ash/wm/base_layout_manager.cc
+++ b/ash/wm/base_layout_manager.cc
@@ -4,13 +4,16 @@
#include "ash/wm/base_layout_manager.h"
+#include "ash/ash_switches.h"
#include "ash/screen_ash.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shell.h"
#include "ash/wm/window_animations.h"
#include "ash/wm/window_properties.h"
#include "ash/wm/window_util.h"
+#include "ash/wm/workspace/stuck_edge_types.h"
#include "ash/wm/workspace/workspace_window_resizer.h"
+#include "base/command_line.h"
#include "ui/aura/client/activation_client.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/root_window.h"
@@ -190,6 +193,7 @@ void BaseLayoutManager::ShowStateChanged(aura::Window* window,
}
void BaseLayoutManager::UpdateBoundsFromShowState(aura::Window* window) {
+ int stuck_edges_mask = GetStuckToEdge(window);
switch (window->GetProperty(aura::client::kShowStateKey)) {
case ui::SHOW_STATE_DEFAULT:
case ui::SHOW_STATE_NORMAL: {
@@ -200,6 +204,9 @@ void BaseLayoutManager::UpdateBoundsFromShowState(aura::Window* window) {
SetChildBoundsDirect(window,
BoundsWithScreenEdgeVisible(window,
bounds_in_parent));
+
+ // getting unstuck
+ stuck_edges_mask = STUCK_EDGE_NONE;
}
ClearRestoreBounds(window);
break;
@@ -208,6 +215,7 @@ void BaseLayoutManager::UpdateBoundsFromShowState(aura::Window* window) {
case ui::SHOW_STATE_MAXIMIZED:
SetChildBoundsDirect(window,
ScreenAsh::GetMaximizedWindowBoundsInParent(window));
+ stuck_edges_mask = STUCK_EDGE_NONE;
break;
case ui::SHOW_STATE_FULLSCREEN:
@@ -215,11 +223,16 @@ void BaseLayoutManager::UpdateBoundsFromShowState(aura::Window* window) {
// TODO(jamescook): Use animation here. Be sure the lock screen works.
SetChildBoundsDirect(
window, ScreenAsh::GetDisplayBoundsInParent(window));
+ stuck_edges_mask = STUCK_EDGE_NONE;
break;
default:
break;
}
+ if (GetStuckToEdge(window) != stuck_edges_mask &&
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAshEnableDockedWindows))
+ SetStuckToEdge(window, stuck_edges_mask);
}
void BaseLayoutManager::AdjustWindowSizesForScreenChange() {
« no previous file with comments | « ash/ash_switches.cc ('k') | ash/wm/property_util.h » ('j') | ash/wm/property_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698