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

Unified Diff: ash/mus/root_window_controller.cc

Issue 2503623002: Support creation of toplevel mus::Windows on separate displays (Closed)
Patch Set: remove default display_id value in .cc Created 4 years, 1 month 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 | « no previous file | ash/mus/test/wm_test_base.h » ('j') | ash/mus/window_manager_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/root_window_controller.cc
diff --git a/ash/mus/root_window_controller.cc b/ash/mus/root_window_controller.cc
index f5da782f9ba624961ad47415a11f907d94d743bb..394c558daeebc0b8398483fbd09b7d89773955c2 100644
--- a/ash/mus/root_window_controller.cc
+++ b/ash/mus/root_window_controller.cc
@@ -102,9 +102,21 @@ ui::Window* RootWindowController::NewTopLevelWindow(
if (GetRequestedContainer(window, &container_id)) {
container_window = GetWindowByShellWindowId(container_id)->mus_window();
} else {
- // TODO(sky): window->bounds() isn't quite right.
+ const gfx::Point top_right_in_screen =
sky 2016/11/23 20:48:19 wm_window has a GetBoundsInScreen. Can't you use i
thanhph 2016/11/23 21:31:42 I can't. I tried to use it as below but got ASAN:D
sky 2016/11/23 21:45:36 This is likely failing because window doesn't have
mfomitchev 2016/11/23 22:00:33 Scott, this will not work if there is a transform
thanhph 2016/11/23 22:25:55 Done, thanks! This is shorter.
+ wm_root_window_controller_->ConvertPointToScreen(
+ WmWindowMus::Get(window), window->bounds().top_right());
+
+ const gfx::Point bottom_left_in_screen =
+ wm_root_window_controller_->ConvertPointToScreen(
+ WmWindowMus::Get(window), window->bounds().bottom_left());
+
+ const gfx::Rect bounds_in_screen =
+ gfx::Rect(bottom_left_in_screen.x(), top_right_in_screen.y(),
+ top_right_in_screen.x() - bottom_left_in_screen.x(),
+ bottom_left_in_screen.y() - top_right_in_screen.y());
+
container_window = WmWindowMus::GetMusWindow(wm::GetDefaultParent(
- WmWindowMus::Get(root_), WmWindowMus::Get(window), window->bounds()));
+ WmWindowMus::Get(root_), WmWindowMus::Get(window), bounds_in_screen));
}
DCHECK(WmWindowMus::Get(container_window)->IsContainer());
« no previous file with comments | « no previous file | ash/mus/test/wm_test_base.h » ('j') | ash/mus/window_manager_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698