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

Unified Diff: components/exo/shell_surface.cc

Issue 2237983002: Allow updating arc widget bounds in maximize/fullscreen state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Allow updating arc widget bounds in maximize/fullscreen state. Created 4 years, 4 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 | « ash/wm/window_state_unittest.cc ('k') | components/exo/shell_surface_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index 72f11c53c45055919cd6cbcda9f83703788b3c8d..71d0f6aafc26542ecdf2fd6b1fd8e8ff0210f494 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -932,6 +932,13 @@ void ShellSurface::CreateShellSurfaceWidget(ui::WindowShowState show_state) {
window->AddObserver(this);
ash::wm::WindowState* window_state = ash::wm::GetWindowState(window);
window_state->AddObserver(this);
+
+ // Absolete positioned shell surfaces may request the bounds that does not
+ // fill the entire work area / display in maximized / fullscreen state.
+ // Allow such clients to update the bounds in these states.
+ if (!initial_bounds_.IsEmpty())
+ window_state->set_allow_set_bounds_in_maximized(true);
+
// Notify client of initial state if different than normal.
if (window_state->GetStateType() != ash::wm::WINDOW_STATE_TYPE_NORMAL &&
!state_changed_callback_.is_null()) {
@@ -1153,8 +1160,19 @@ void ShellSurface::UpdateWidgetBounds() {
DCHECK(widget_);
// Return early if the shell is currently managing the bounds of the widget.
- if (widget_->IsMaximized() || widget_->IsFullscreen() || IsResizing())
+ // 1) When a window is either maximized/fullscreen/pinned, and the bounds
+ // isn't controlled by a clientt.
reveman 2016/08/15 16:19:37 nit: client
oshima 2016/08/15 17:27:03 Done.
+ // 2) When a window is being dragged.
reveman 2016/08/15 16:19:37 nit: move this comment below to the IsResizing ear
oshima 2016/08/15 17:27:03 Done.
+ ash::wm::WindowState* window_state =
+ ash::wm::GetWindowState(widget_->GetNativeWindow());
+ if (window_state->IsMaximizedOrFullscreenOrPinned() &&
+ !window_state->allow_set_bounds_in_maximized()) {
return;
+ }
+
+ if (IsResizing()) {
+ return;
+ }
reveman 2016/08/15 16:19:37 nit: no need for {} here
oshima 2016/08/15 17:27:03 Done.
// Return early if there is pending configure requests.
if (!pending_configs_.empty() || scoped_configure_)
« no previous file with comments | « ash/wm/window_state_unittest.cc ('k') | components/exo/shell_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698