OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/wm/overview/scoped_transform_overview_window.h" | 5 #include "ash/wm/overview/scoped_transform_overview_window.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/wm/window_state.h" | 8 #include "ash/wm/window_state.h" |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/client/screen_position_client.h" | 10 #include "ui/aura/client/screen_position_client.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
179 AnimateTransformOnWindowAndTransientChildren(original_transform_); | 179 AnimateTransformOnWindowAndTransientChildren(original_transform_); |
180 window_copy_ = NULL; | 180 window_copy_ = NULL; |
181 layer_ = NULL; | 181 layer_ = NULL; |
182 if (minimized_ && window_->GetProperty(aura::client::kShowStateKey) != | 182 if (minimized_ && window_->GetProperty(aura::client::kShowStateKey) != |
183 ui::SHOW_STATE_MINIMIZED) { | 183 ui::SHOW_STATE_MINIMIZED) { |
184 // Setting opacity 0 and visible false ensures that the property change | 184 // Setting opacity 0 and visible false ensures that the property change |
185 // to SHOW_STATE_MINIMIZED will not animate the window from its original | 185 // to SHOW_STATE_MINIMIZED will not animate the window from its original |
186 // bounds to the minimized position. | 186 // bounds to the minimized position. |
187 window_->layer()->SetOpacity(0); | 187 window_->layer()->SetOpacity(0); |
188 window_->Hide(); | 188 window_->Hide(); |
189 // Hiding the window does not update the layer visibility because opacity | |
190 // is animating to 0 (See VisibilityController::UpdateLayerVisibility). | |
191 // Showing the window later requires that the layer visibility is false. | |
192 window_->layer()->SetVisible(false); | |
flackr
2013/10/01 16:09:12
This is really a workaround. I described the full
| |
189 window_->SetProperty(aura::client::kShowStateKey, | 193 window_->SetProperty(aura::client::kShowStateKey, |
190 ui::SHOW_STATE_MINIMIZED); | 194 ui::SHOW_STATE_MINIMIZED); |
191 } | 195 } |
192 ash::wm::GetWindowState(window_)->set_ignored_by_shelf(ignored_by_shelf_); | 196 ash::wm::GetWindowState(window_)->set_ignored_by_shelf(ignored_by_shelf_); |
193 } else if (window_copy_) { | 197 } else if (window_copy_) { |
194 // If this class still owns a copy of the window, clean up the copy. This | 198 // If this class still owns a copy of the window, clean up the copy. This |
195 // will be the case if the window was destroyed. | 199 // will be the case if the window was destroyed. |
196 window_copy_->Close(); | 200 window_copy_->Close(); |
197 if (layer_) | 201 if (layer_) |
198 views::corewm::DeepDeleteLayers(layer_); | 202 views::corewm::DeepDeleteLayers(layer_); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
289 transient_child->SetTransform(transient_window_transform); | 293 transient_child->SetTransform(transient_window_transform); |
290 } | 294 } |
291 } | 295 } |
292 | 296 |
293 void ScopedTransformOverviewWindow::OnOverviewStarted() { | 297 void ScopedTransformOverviewWindow::OnOverviewStarted() { |
294 ash::wm::GetWindowState(window_)->set_ignored_by_shelf(true); | 298 ash::wm::GetWindowState(window_)->set_ignored_by_shelf(true); |
295 RestoreWindow(); | 299 RestoreWindow(); |
296 } | 300 } |
297 | 301 |
298 } // namespace ash | 302 } // namespace ash |
OLD | NEW |