diff options
author | zmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-19 22:41:47 +0000 |
---|---|---|
committer | zmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-19 22:41:47 +0000 |
commit | aa0025bf8d57cc793308f4f881ed5817cb141141 (patch) | |
tree | 80b0a3707cc1131eb63a59226f78bd85d4e0bdd7 | |
parent | 0cf821bd937986aafdd3472ad00acd1b152de957 (diff) | |
download | chromium_src-aa0025bf8d57cc793308f4f881ed5817cb141141.zip chromium_src-aa0025bf8d57cc793308f4f881ed5817cb141141.tar.gz chromium_src-aa0025bf8d57cc793308f4f881ed5817cb141141.tar.bz2 |
Set the correct content window parameters for the "soft" fullscreen mode:
1) make the window "topmost" (but still won't overide TaskManager)
2) add the ex-style of WS_EX_TOOLWINDOW so the content window won't show in the TaskBar when in "soft" fullscreen mode. Otherwise it shows, and when you click on it or press ctrl-del-alt, o3d will get out of fullscreen mode, but this content window will linger in the TaskBar.
Review URL: http://codereview.chromium.org/651003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39500 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | o3d/plugin/win/main_win.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/o3d/plugin/win/main_win.cc b/o3d/plugin/win/main_win.cc index f9be934..708e84d 100644 --- a/o3d/plugin/win/main_win.cc +++ b/o3d/plugin/win/main_win.cc @@ -712,6 +712,9 @@ void ReplaceContentWindow(HWND content_hwnd, LONG_PTR style = ::GetWindowLongPtr(content_hwnd, GWL_STYLE); style |= WS_CHILD; ::SetWindowLongPtr(content_hwnd, GWL_STYLE, style); + LONG_PTR exstyle = ::GetWindowLongPtr(content_hwnd, GWL_EXSTYLE); + exstyle &= ~WS_EX_TOOLWINDOW; + ::SetWindowLongPtr(content_hwnd, GWL_EXSTYLE, exstyle); ::SetParent(content_hwnd, containing_hwnd); BOOL res = ::SetWindowPos(content_hwnd, containing_hwnd, 0, 0, width, height, @@ -973,13 +976,18 @@ bool PluginObject::RequestFullscreenDisplay() { LONG_PTR style = ::GetWindowLongPtr(GetContentHWnd(), GWL_STYLE); style &= ~WS_CHILD; ::SetWindowLongPtr(GetContentHWnd(), GWL_STYLE, style); + // Add WS_EX_TOOLWINDOW to the window exstyle so the content window won't + // show in the Taskbar. + LONG_PTR exstyle = ::GetWindowLongPtr(GetContentHWnd(), GWL_EXSTYLE); + exstyle |= WS_EX_TOOLWINDOW; + ::SetWindowLongPtr(GetContentHWnd(), GWL_EXSTYLE, exstyle); ::ShowWindow(GetContentHWnd(), SW_SHOW); // We need to resize the full-screen window to the desired size of // the display mode early, before calling // Renderer::GoFullscreen(). RECT screen_rect; if (GetScreenRect(GetPluginHWnd(), &screen_rect)) { - ::SetWindowPos(GetContentHWnd(), HWND_TOP, + ::SetWindowPos(GetContentHWnd(), HWND_TOPMOST, screen_rect.left, screen_rect.top, screen_rect.right - screen_rect.left + 1, screen_rect.bottom - screen_rect.top + 1, |