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

Unified Diff: ui/views/mus/desktop_window_tree_host_mus.cc

Issue 2576533003: Converts some services to use aura-mus (Closed)
Patch Set: remove log Created 4 years 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 | « ui/views/mus/desktop_window_tree_host_mus.h ('k') | ui/views/mus/pointer_watcher_event_router2.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8d441d911bc0579c9e80727edf4352220d9b73c0..65c742653c88793dfba774be76c273bb0c7956ac 100644
--- a/ui/views/mus/desktop_window_tree_host_mus.cc
+++ b/ui/views/mus/desktop_window_tree_host_mus.cc
@@ -31,6 +31,11 @@ namespace views {
namespace {
+bool ShouldSetClientArea(views::Widget::InitParams::Type type) {
+ using WIP = views::Widget::InitParams;
+ return type == WIP::TYPE_WINDOW || type == WIP::TYPE_PANEL;
+}
+
// As the window manager renderers the non-client decorations this class does
// very little but honor the client area insets from the window manager.
class ClientSideNonClientFrameView : public NonClientFrameView {
@@ -196,6 +201,9 @@ bool DesktopWindowTreeHostMus::IsDocked() const {
}
void DesktopWindowTreeHostMus::SendClientAreaToServer() {
+ if (!ShouldSetClientArea(desktop_native_widget_aura_->widget_type()))
+ return;
+
NonClientView* non_client_view =
native_widget_delegate_->AsWidget()->non_client_view();
if (!non_client_view || !non_client_view->client_view())
@@ -255,6 +263,14 @@ void DesktopWindowTreeHostMus::OnNativeWidgetCreated(
native_widget_delegate_->OnNativeWidgetCreated(true);
}
+void DesktopWindowTreeHostMus::OnWidgetInitDone() {
+ // Because of construction order it's possible the bounds have changed before
+ // the NonClientView was created, which means we may not have sent the
+ // client-area and hit-test-mask.
+ SendClientAreaToServer();
+ SendHitTestMaskToServer();
+}
+
std::unique_ptr<corewm::Tooltip> DesktopWindowTreeHostMus::CreateTooltip() {
return base::MakeUnique<corewm::TooltipAura>();
}
@@ -537,6 +553,9 @@ void DesktopWindowTreeHostMus::SetVisibilityChangedAnimationsEnabled(
}
NonClientFrameView* DesktopWindowTreeHostMus::CreateNonClientFrameView() {
+ if (!ShouldSetClientArea(desktop_native_widget_aura_->widget_type()))
+ return nullptr;
+
return new ClientSideNonClientFrameView(native_widget_delegate_->AsWidget());
}
« no previous file with comments | « ui/views/mus/desktop_window_tree_host_mus.h ('k') | ui/views/mus/pointer_watcher_event_router2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698