Chromium Code Reviews| Index: components/exo/shell_surface.cc |
| diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc |
| index e51f8c00195d1ff9df7cccf6b35e53e4431cca36..5a7a634c343985d215e213893878c79822024dfc 100644 |
| --- a/components/exo/shell_surface.cc |
| +++ b/components/exo/shell_surface.cc |
| @@ -373,6 +373,7 @@ ShellSurface::ShellSurface(Surface* surface, |
| can_minimize_(can_minimize), |
| container_(container) { |
| WMHelper::GetInstance()->AddActivationObserver(this); |
| + WMHelper::GetInstance()->AddShellObserver(this); |
| surface_->SetSurfaceDelegate(this); |
| surface_->AddSurfaceObserver(this); |
| surface_->window()->Show(); |
| @@ -405,6 +406,7 @@ ShellSurface::~ShellSurface() { |
| widget_->CloseNow(); |
| } |
| WMHelper::GetInstance()->RemoveActivationObserver(this); |
| + WMHelper::GetInstance()->RemoveShellObserver(this); |
| if (parent_) |
| parent_->RemoveObserver(this); |
| if (surface_) { |
| @@ -934,6 +936,8 @@ void ShellSurface::OnPreWindowStateTypeChange( |
| ash::wm::WindowStateType new_type = window_state->GetStateType(); |
| if (ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(old_type) || |
| ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(new_type)) { |
| + EndDragOrMove(false /* revert */); |
|
reveman
2017/01/23 20:23:48
how is other chrome windows handling this?
Dominik Laskowski
2017/01/23 23:01:36
It's not handled. If you enter full screen after d
reveman
2017/01/26 06:50:21
That sounds like a bug. Is there a more general wa
|
| + |
| // When transitioning in/out of maximized or fullscreen mode we need to |
| // make sure we have a configure callback before we allow the default |
| // cross-fade animations. The configure callback provides a mechanism for |
| @@ -1028,6 +1032,18 @@ void ShellSurface::OnWindowActivated( |
| } |
| //////////////////////////////////////////////////////////////////////////////// |
| +// WMHelper::ShellObserver overrides: |
| + |
| +void ShellSurface::OnOverviewModeStarted() { |
| + EndDragOrMove(false /* revert */); |
|
reveman
2017/01/23 20:23:48
is this also a problem for non-exo window dragging
Dominik Laskowski
2017/01/23 23:01:36
Yes, entering/exiting overview mode while dragging
reveman
2017/01/26 06:50:21
Ok, let's do Ash first and once that lands we'll m
|
| + ignore_widget_bounds_changes_ = true; |
|
reveman
2017/01/23 20:23:48
why is this needed? seems fragile to rely on us de
Dominik Laskowski
2017/01/23 23:01:36
When entering overview mode, a lost focus event ca
reveman
2017/01/26 06:50:21
Why do they need to be discarded? Doesn't this lea
|
| +} |
| + |
| +void ShellSurface::OnOverviewModeEnded() { |
| + ignore_widget_bounds_changes_ = false; |
| +} |
| + |
| +//////////////////////////////////////////////////////////////////////////////// |
| // WMHelper::AccessibilityObserver overrides: |
| void ShellSurface::OnAccessibilityModeChanged() { |
| @@ -1410,8 +1426,8 @@ void ShellSurface::UpdateWidgetBounds() { |
| return; |
| } |
| - // 2) When a window is being dragged. |
| - if (IsResizing()) |
| + // 2) When a window is being dragged, or is being moved by the shell. |
| + if (IsResizing() || ignore_widget_bounds_changes_) |
| return; |
| // Return early if there is pending configure requests. |