Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: plugin/win/main_win.cc

Issue 606005: Fix the software renderer "soft" fullscreen mode using the wrong monitor bug. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/win/d3d9/renderer_d3d9.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: plugin/win/main_win.cc
===================================================================
--- plugin/win/main_win.cc (revision 38988)
+++ plugin/win/main_win.cc (working copy)
@@ -720,6 +720,25 @@
::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 @@
// 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());
« no previous file with comments | « core/win/d3d9/renderer_d3d9.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698