diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-24 22:17:18 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-24 22:17:18 +0000 |
commit | 5978af5ee12a93ef7089ccccd35ab58b68904337 (patch) | |
tree | 3a2e918a179b7d9be800f6b0d5483e156055ccd2 /ui/aura/desktop.cc | |
parent | 2b89cb916a32323432bd26ce87834bd485aa9d2d (diff) | |
download | chromium_src-5978af5ee12a93ef7089ccccd35ab58b68904337.zip chromium_src-5978af5ee12a93ef7089ccccd35ab58b68904337.tar.gz chromium_src-5978af5ee12a93ef7089ccccd35ab58b68904337.tar.bz2 |
aura: Try to make Linux host resize code more reliable.
There's no guarantee that we'll get the host window size that
we ask for. This adjusts WindowTest.Transform to not ask for
a specific size, and instead just use the size it's been
given.
I also fixed a race in DesktopHostLinux::Show() when running
under X window managers that don't take the _WM_S0 selection.
We now wait for notification that the host window has been
mapped before trying to focus it.
I moved the logic for choosing to create a fullscreen host
window out of DesktopHostLinux and into the browser.
Finally, I changed DesktopHostLinux::SetSize() (called by
Desktop::SetHostSize()) update the internal size and notify
the desktop immediately.
BUG=100979,100894
TEST=tests pass on ion3; fullscreen window is created on chrome os
Review URL: http://codereview.chromium.org/8374005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106989 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/desktop.cc')
-rw-r--r-- | ui/aura/desktop.cc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/ui/aura/desktop.cc b/ui/aura/desktop.cc index 7824c12..bbc6e2a 100644 --- a/ui/aura/desktop.cc +++ b/ui/aura/desktop.cc @@ -41,11 +41,9 @@ static const int kDefaultHostWindowHeight = 1024; } // namespace -// static Desktop* Desktop::instance_ = NULL; - -// static ui::Compositor*(*Desktop::compositor_factory_)() = NULL; +bool Desktop::use_fullscreen_host_window_ = false; Desktop::Desktop() : Window(NULL), @@ -411,26 +409,29 @@ bool Desktop::IsFocusedWindow(const Window* window) const { void Desktop::Init() { Window::Init(); - SetBounds(gfx::Rect(gfx::Point(), host_->GetSize())); + SetBounds(gfx::Rect(host_->GetSize())); Show(); compositor()->SetRootLayer(layer()); } gfx::Rect Desktop::GetInitialHostWindowBounds() const { + gfx::Rect bounds(kDefaultHostWindowX, kDefaultHostWindowY, + kDefaultHostWindowWidth, kDefaultHostWindowHeight); + const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kAuraHostWindowSize); - - int width = 0, height = 0; vector<string> parts; base::SplitString(size_str, 'x', &parts); - if (parts.size() != 2 || - !base::StringToInt(parts[0], &width) || - !base::StringToInt(parts[1], &height) || - width <= 0 || height <= 0) { - width = kDefaultHostWindowWidth; - height = kDefaultHostWindowHeight; + int parsed_width = 0, parsed_height = 0; + if (parts.size() == 2 && + base::StringToInt(parts[0], &parsed_width) && parsed_width > 0 && + base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { + bounds.set_size(gfx::Size(parsed_width, parsed_height)); + } else if (use_fullscreen_host_window_) { + bounds = gfx::Rect(DesktopHost::GetNativeDisplaySize()); } - return gfx::Rect(kDefaultHostWindowX, kDefaultHostWindowY, width, height); + + return bounds; } } // namespace aura |