diff options
author | zmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-16 19:31:15 +0000 |
---|---|---|
committer | zmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-16 19:31:15 +0000 |
commit | 083cd0e24ccdb428462240ced4ee123cad21459d (patch) | |
tree | 197e39d26e5e0408322dd71f61bfe4bc51310122 /o3d | |
parent | 8e708e1fb5cd095371e71cf69beedbfe0d67ffd9 (diff) | |
download | chromium_src-083cd0e24ccdb428462240ced4ee123cad21459d.zip chromium_src-083cd0e24ccdb428462240ced4ee123cad21459d.tar.gz chromium_src-083cd0e24ccdb428462240ced4ee123cad21459d.tar.bz2 |
Re-applying patch from http://codereview.chromium.org/606005 .
Already reviewed by Vangelis.
Review URL: http://codereview.chromium.org/609006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39114 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/core/win/d3d9/renderer_d3d9.cc | 8 | ||||
-rw-r--r-- | o3d/plugin/win/main_win.cc | 29 |
2 files changed, 33 insertions, 4 deletions
diff --git a/o3d/core/win/d3d9/renderer_d3d9.cc b/o3d/core/win/d3d9/renderer_d3d9.cc index c7d86c0..2e55ddd 100644 --- a/o3d/core/win/d3d9/renderer_d3d9.cc +++ b/o3d/core/win/d3d9/renderer_d3d9.cc @@ -1391,6 +1391,14 @@ bool RendererD3D9::GoFullscreen(const DisplayWindow& display, int refresh_rate = 0; bool windowed = true; + // With software renderer, always use DISPLAY_MODE_DEFAULT. + // This is due to a bug in software renderer that only the primary + // monitor/adapter is recognized. + ClientInfoManager* client_info_manager = + service_locator()->GetService<ClientInfoManager>(); + if (client_info_manager->client_info().software_renderer()) + mode_id = DISPLAY_MODE_DEFAULT; + // Look up the refresh rate, width and height. DisplayMode mode; if (!GetDisplayMode(mode_id, &mode)) { diff --git a/o3d/plugin/win/main_win.cc b/o3d/plugin/win/main_win.cc index 7641611..f9be934 100644 --- a/o3d/plugin/win/main_win.cc +++ b/o3d/plugin/win/main_win.cc @@ -720,6 +720,25 @@ void ReplaceContentWindow(HWND content_hwnd, ::ShowWindow(content_hwnd, SW_SHOW); } +// Get the screen rect of the monitor the window is on, in virtual screen +// coordinates. +// Return true on success, false on failure. +bool GetScreenRect(HWND hwnd, + RECT* rect) { + HMONITOR monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONULL); + if (monitor == NULL) + return false; + + MONITORINFO monitor_info; + monitor_info.cbSize = sizeof(monitor_info); + if (GetMonitorInfo(monitor, &monitor_info)) { + *rect = monitor_info.rcMonitor; + return true; + } else { + return false; + } +} + } // namespace anonymous #if defined(O3D_INTERNAL_PLUGIN) @@ -958,10 +977,12 @@ bool PluginObject::RequestFullscreenDisplay() { // We need to resize the full-screen window to the desired size of // the display mode early, before calling // Renderer::GoFullscreen(). - o3d::DisplayMode mode; - if (GetDisplayMode(fullscreen_region_mode_id_, &mode)) { - ::SetWindowPos(GetContentHWnd(), HWND_TOP, 0, 0, - mode.width(), mode.height(), + RECT screen_rect; + if (GetScreenRect(GetPluginHWnd(), &screen_rect)) { + ::SetWindowPos(GetContentHWnd(), HWND_TOP, + screen_rect.left, screen_rect.top, + screen_rect.right - screen_rect.left + 1, + screen_rect.bottom - screen_rect.top + 1, SWP_NOZORDER | SWP_NOREPOSITION | SWP_ASYNCWINDOWPOS); DisplayWindowWindows display; display.set_hwnd(GetContentHWnd()); |