diff options
Diffstat (limited to 'ui/aura')
-rw-r--r-- | ui/aura/display_manager.cc | 9 | ||||
-rw-r--r-- | ui/aura/root_window_host_linux.cc | 5 |
2 files changed, 8 insertions, 6 deletions
diff --git a/ui/aura/display_manager.cc b/ui/aura/display_manager.cc index 59c2625..ca5157b 100644 --- a/ui/aura/display_manager.cc +++ b/ui/aura/display_manager.cc @@ -33,11 +33,10 @@ gfx::Display DisplayManager::CreateDisplayFromSpec(const std::string& spec) { kDefaultHostWindowWidth, kDefaultHostWindowHeight); int x = 0, y = 0, width, height; float scale = 1.0f; - if (sscanf(spec.c_str(), "%dx%d*%f", &width, &height, &scale) >= 2) { - bounds.set_size(gfx::Size(width, height)); - } else if (sscanf(spec.c_str(), "%d+%d-%dx%d*%f", &x, &y, &width, &height, - &scale) >= 4 ) { - bounds = gfx::Rect(x, y, width, height); + if (sscanf(spec.c_str(), "%dx%d*%f", &width, &height, &scale) >= 2 || + sscanf(spec.c_str(), "%d+%d-%dx%d*%f", &x, &y, &width, &height, + &scale) >= 4) { + bounds.SetRect(x, y, width, height); } else if (use_fullscreen_host_window_) { bounds = gfx::Rect(aura::RootWindowHost::GetNativeScreenSize()); } diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc index c8e61e0..0b4fa95 100644 --- a/ui/aura/root_window_host_linux.cc +++ b/ui/aura/root_window_host_linux.cc @@ -710,9 +710,12 @@ void RootWindowHostLinux::Show() { // Before we map the window, set size hints. Otherwise, some window managers // will ignore toplevel XMoveWindow commands. XSizeHints size_hints; - size_hints.flags = PPosition; + size_hints.flags = PPosition | PWinGravity; size_hints.x = bounds_.x(); size_hints.y = bounds_.y(); + // Set StaticGravity so that the window position is not affected by the + // frame width when running with window manager. + size_hints.win_gravity = StaticGravity; XSetWMNormalHints(xdisplay_, xwindow_, &size_hints); XMapWindow(xdisplay_, xwindow_); |