Chromium Code Reviews| Index: ui/views/mus/desktop_window_tree_host_mus.cc |
| diff --git a/ui/views/mus/desktop_window_tree_host_mus.cc b/ui/views/mus/desktop_window_tree_host_mus.cc |
| index 9731c9d9179ff015fb8372768ecfac04c951c7e4..77c69889bd6b70890225a78c91bc20162825e42d 100644 |
| --- a/ui/views/mus/desktop_window_tree_host_mus.cc |
| +++ b/ui/views/mus/desktop_window_tree_host_mus.cc |
| @@ -122,12 +122,20 @@ void DesktopWindowTreeHostMus::ShowMaximizedWithBounds( |
| } |
| bool DesktopWindowTreeHostMus::IsVisible() const { |
| + // Go through the Widget api for checking visibility as it has additional |
|
msw
2016/11/10 01:33:56
Hmm, Widget::IsVisible() just returns |native_widg
sky
2016/11/10 05:44:46
Good call. fixed!
|
| + // checks beyond checking the aura::Window. |
| + if (parent_ && !parent_->native_widget_delegate_->AsWidget()->IsVisible()) |
| + return false; |
| return window()->IsVisible(); |
| } |
| void DesktopWindowTreeHostMus::SetSize(const gfx::Size& size) { |
| - // TODO: handle device scale, http://crbug.com/663524. |
| - SetBounds(gfx::Rect(window()->bounds().origin(), size)); |
| + // Use GetBounds() as the origin of window() is always at 0, 0. |
| + gfx::Rect screen_bounds = GetBounds(); |
| + // TODO: handle device scale, http://crbug.com/663524. Also, |screen_bounds| |
| + // is in pixels and should be dip. |
| + screen_bounds.set_size(size); |
| + SetBounds(screen_bounds); |
| } |
| void DesktopWindowTreeHostMus::StackAbove(aura::Window* window) { |