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

Side by Side Diff: components/exo/shell_surface.cc

Issue 2780623002: exo: Fix multi-display hardware cursor (Closed)
Patch Set: Rebase properly Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/shell_surface.h" 5 #include "components/exo/shell_surface.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/common/frame/custom_frame_view_ash.h" 9 #include "ash/common/frame/custom_frame_view_ash.h"
10 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 DCHECK(!widget_); 1145 DCHECK(!widget_);
1146 1146
1147 views::Widget::InitParams params; 1147 views::Widget::InitParams params;
1148 params.type = views::Widget::InitParams::TYPE_WINDOW; 1148 params.type = views::Widget::InitParams::TYPE_WINDOW;
1149 params.ownership = views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET; 1149 params.ownership = views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET;
1150 params.delegate = this; 1150 params.delegate = this;
1151 params.shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE; 1151 params.shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE;
1152 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 1152 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
1153 params.show_state = show_state; 1153 params.show_state = show_state;
1154 // Make shell surface a transient child if |parent_| has been set. 1154 // Make shell surface a transient child if |parent_| has been set.
1155 params.parent = 1155 params.parent = parent_ ? parent_
reveman 2017/03/30 07:47:53 how is this change related?
Dominik Laskowski 2017/04/05 17:59:25 GetContainer gained a parameter.
1156 parent_ ? parent_ : WMHelper::GetInstance()->GetContainer(container_); 1156 : WMHelper::GetInstance()->GetContainer(
1157 primary_display_id_, container_);
1157 params.bounds = gfx::Rect(origin_, gfx::Size()); 1158 params.bounds = gfx::Rect(origin_, gfx::Size());
1158 bool activatable = activatable_; 1159 bool activatable = activatable_;
1159 // ShellSurfaces in system modal container are only activatable if input 1160 // ShellSurfaces in system modal container are only activatable if input
1160 // region is non-empty. See OnCommitSurface() for more details. 1161 // region is non-empty. See OnCommitSurface() for more details.
1161 if (container_ == ash::kShellWindowId_SystemModalContainer) 1162 if (container_ == ash::kShellWindowId_SystemModalContainer)
1162 activatable &= !surface_->GetHitTestBounds().IsEmpty(); 1163 activatable &= !surface_->GetHitTestBounds().IsEmpty();
1163 params.activatable = activatable ? views::Widget::InitParams::ACTIVATABLE_YES 1164 params.activatable = activatable ? views::Widget::InitParams::ACTIVATABLE_YES
1164 : views::Widget::InitParams::ACTIVATABLE_NO; 1165 : views::Widget::InitParams::ACTIVATABLE_NO;
1165 1166
1166 // Note: NativeWidget owns this widget. 1167 // Note: NativeWidget owns this widget.
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 gfx::Point ShellSurface::GetMouseLocation() const { 1700 gfx::Point ShellSurface::GetMouseLocation() const {
1700 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); 1701 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow();
1701 gfx::Point location = 1702 gfx::Point location =
1702 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); 1703 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
1703 aura::Window::ConvertPointToTarget( 1704 aura::Window::ConvertPointToTarget(
1704 root_window, widget_->GetNativeWindow()->parent(), &location); 1705 root_window, widget_->GetNativeWindow()->parent(), &location);
1705 return location; 1706 return location;
1706 } 1707 }
1707 1708
1708 } // namespace exo 1709 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698