diff options
author | mazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-19 20:29:15 +0000 |
---|---|---|
committer | mazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-19 20:29:15 +0000 |
commit | e703426755e1548ffbb0dfffa7f48fa103e48968 (patch) | |
tree | 368e51cf3cebc3e923e6c8b6cd12eaf092ddc4f0 /ui/aura | |
parent | 780fc824225e958594b4b0334f3d6d2dbc5ebf4e (diff) | |
download | chromium_src-e703426755e1548ffbb0dfffa7f48fa103e48968.zip chromium_src-e703426755e1548ffbb0dfffa7f48fa103e48968.tar.gz chromium_src-e703426755e1548ffbb0dfffa7f48fa103e48968.tar.bz2 |
Enable UpdateDisplay to specify host origins.
This is needed for testing coordinate conversions by way of native screen
coordinates.
BUG=148686
Review URL: https://chromiumcodereview.appspot.com/10914308
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157597 0039d316-1c4b-4281-b951-d872f2087c98
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_); |