diff options
author | gangji@google.com <gangji@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-12 01:03:48 +0000 |
---|---|---|
committer | gangji@google.com <gangji@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-12 01:03:48 +0000 |
commit | 5cdf6cec850dd6f2deb124713d855171d1f4d094 (patch) | |
tree | d20729b85c8e15d36d2e690e1899d4ae3c69a436 /o3d | |
parent | 623c0bd198a26b6609c7545a0cce0578dbad5316 (diff) | |
download | chromium_src-5cdf6cec850dd6f2deb124713d855171d1f4d094.zip chromium_src-5cdf6cec850dd6f2deb124713d855171d1f4d094.tar.gz chromium_src-5cdf6cec850dd6f2deb124713d855171d1f4d094.tar.bz2 |
Enable O2D fullscreen mode for Linux system.
TEST=verified on chrome and firefox under ubuntu.
Review URL: http://codereview.chromium.org/6686015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77904 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/core/cross/cairo/renderer_cairo.cc | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/o3d/core/cross/cairo/renderer_cairo.cc b/o3d/core/cross/cairo/renderer_cairo.cc index d66634c..eff69ff 100644 --- a/o3d/core/cross/cairo/renderer_cairo.cc +++ b/o3d/core/cross/cairo/renderer_cairo.cc @@ -452,7 +452,19 @@ bool RendererCairo::GoFullscreen(const DisplayWindow& display, int mode_id) { if (!fullscreen_) { DLOG(INFO) << "RendererCairo entering fullscreen"; -#if defined(OS_WIN) +#if defined(OS_LINUX) + const DisplayWindowLinux &display_platform = + static_cast<const DisplayWindowLinux&>(display); + display_ = display_platform.display(); + window_ = display_platform.window(); + XWindowAttributes window_attributes; + if (XGetWindowAttributes(display_, window_, &window_attributes)) { + fullscreen_ = true; + SetClientSize(window_attributes.width, window_attributes.height); + DestroyCairoSurface(); + CreateCairoSurface(); + } +#elif defined(OS_WIN) DEVMODE dev_mode; if (hwnd_ != NULL && EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode)) { @@ -477,16 +489,26 @@ bool RendererCairo::GoFullscreen(const DisplayWindow& display, // Returns true on success, false on failure. bool RendererCairo::CancelFullscreen(const DisplayWindow& display, int width, int height) { -#if defined(OS_WIN) - if (hwnd_ == NULL) { - // Not initialized. - return false; - } -#endif if (fullscreen_) { DLOG(INFO) << "RendererCairo exiting fullscreen"; +#if defined(OS_LINUX) + const DisplayWindowLinux &display_platform = + static_cast<const DisplayWindowLinux&>(display); + display_ = display_platform.display(); + window_ = display_platform.window(); + + fullscreen_ = false; + SetClientSize(width, height); + DestroyCairoSurface(); + CreateCairoSurface(); +#elif defined(OS_WIN) + if (hwnd_ == NULL) { + // Not initialized. + return false; + } fullscreen_ = false; Resize(width, height); +#endif } return true; } |