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

Unified Diff: ash/common/wm/default_state.cc

Issue 2822613004: [M58] ash: Do not constrain window bounds if requested (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | ash/common/wm/maximize_mode/maximize_mode_window_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/default_state.cc
diff --git a/ash/common/wm/default_state.cc b/ash/common/wm/default_state.cc
index 8149d7f856fc21a1871835fbd425b90fb7595c3e..0a77fa11dddf34b5acae2051a89a96a9aa752223 100644
--- a/ash/common/wm/default_state.cc
+++ b/ash/common/wm/default_state.cc
@@ -452,6 +452,7 @@ bool DefaultState::ProcessWorkspaceEvents(WindowState* window_state,
// If a window is opened as maximized or fullscreen, its bounds may be
// empty, so update the bounds now before checking empty.
if (window_state->is_dragged() ||
+ window_state->allow_set_bounds_direct() ||
SetMaximizedOrFullscreenBounds(window_state)) {
return true;
}
@@ -487,6 +488,7 @@ bool DefaultState::ProcessWorkspaceEvents(WindowState* window_state,
}
case WM_EVENT_DISPLAY_BOUNDS_CHANGED: {
if (window_state->is_dragged() ||
+ window_state->allow_set_bounds_direct() ||
SetMaximizedOrFullscreenBounds(window_state)) {
return true;
}
@@ -512,6 +514,7 @@ bool DefaultState::ProcessWorkspaceEvents(WindowState* window_state,
return true;
if (window_state->is_dragged() ||
+ window_state->allow_set_bounds_direct() ||
SetMaximizedOrFullscreenBounds(window_state)) {
return true;
}
@@ -554,6 +557,7 @@ bool DefaultState::ProcessWorkspaceEvents(WindowState* window_state,
// static
bool DefaultState::SetMaximizedOrFullscreenBounds(WindowState* window_state) {
DCHECK(!window_state->is_dragged());
+ DCHECK(!window_state->allow_set_bounds_direct());
if (window_state->IsMaximized()) {
window_state->SetBoundsDirect(
GetMaximizedWindowBoundsInParent(window_state->window()));
@@ -570,7 +574,7 @@ bool DefaultState::SetMaximizedOrFullscreenBounds(WindowState* window_state) {
// static
void DefaultState::SetBounds(WindowState* window_state,
const SetBoundsEvent* event) {
- if (window_state->is_dragged()) {
+ if (window_state->is_dragged() || window_state->allow_set_bounds_direct()) {
// TODO(oshima|varkha): This may be no longer needed, as the dragging
// happens in docked window container. crbug.com/485612.
window_state->SetBoundsDirect(event->requested_bounds());
@@ -581,8 +585,7 @@ void DefaultState::SetBounds(WindowState* window_state,
wm::AdjustBoundsSmallerThan(work_area_in_parent.size(), &child_bounds);
window_state->AdjustSnappedBounds(&child_bounds);
window_state->SetBoundsDirect(child_bounds);
- } else if (!SetMaximizedOrFullscreenBounds(window_state) ||
- window_state->allow_set_bounds_in_maximized()) {
+ } else if (!SetMaximizedOrFullscreenBounds(window_state)) {
window_state->SetBoundsConstrained(event->requested_bounds());
}
}
« no previous file with comments | « no previous file | ash/common/wm/maximize_mode/maximize_mode_window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698