diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-10 19:09:07 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-10 19:09:07 +0000 |
commit | 8d439a694371cfdd95c0c03ff452c9096d3cc7f3 (patch) | |
tree | 14ef281438f753ded9d64d7475059fe95fb89a88 /chrome/common | |
parent | 695225e97e2ea163dac3b63659c05eb36f94bfd9 (diff) | |
download | chromium_src-8d439a694371cfdd95c0c03ff452c9096d3cc7f3.zip chromium_src-8d439a694371cfdd95c0c03ff452c9096d3cc7f3.tar.gz chromium_src-8d439a694371cfdd95c0c03ff452c9096d3cc7f3.tar.bz2 |
Make Chromium windows not hide auto-hide taskbars, take 2.
This is very similar to r10845, but also includes a regression fix for issue 8410, where locking and unlocking the screen would cause mispositioning of child content.
BUG=20,8410
Review URL: http://codereview.chromium.org/42027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11355 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/win_util.cc | 12 | ||||
-rw-r--r-- | chrome/common/win_util.h | 7 |
2 files changed, 19 insertions, 0 deletions
diff --git a/chrome/common/win_util.cc b/chrome/common/win_util.cc index 07a1b08..9569b00 100644 --- a/chrome/common/win_util.cc +++ b/chrome/common/win_util.cc @@ -28,6 +28,8 @@ namespace win_util { +const int kAutoHideTaskbarThicknessPx = 2; + namespace { // Enforce visible dialog box. @@ -626,6 +628,16 @@ void CenterAndSizeWindow(HWND parent, HWND window, const SIZE& pref, } } +bool EdgeHasAutoHideTaskbar(UINT edge, HMONITOR monitor) { + APPBARDATA taskbar_data = { 0 }; + taskbar_data.cbSize = sizeof APPBARDATA; + taskbar_data.uEdge = edge; + HWND taskbar = reinterpret_cast<HWND>(SHAppBarMessage(ABM_GETAUTOHIDEBAR, + &taskbar_data)); + return ::IsWindow(taskbar) && + (MonitorFromWindow(taskbar, MONITOR_DEFAULTTONEAREST) == monitor); +} + HANDLE GetSectionFromProcess(HANDLE section, HANDLE process, bool read_only) { HANDLE valid_section = NULL; DWORD access = STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ; diff --git a/chrome/common/win_util.h b/chrome/common/win_util.h index c93b098..8e703cb 100644 --- a/chrome/common/win_util.h +++ b/chrome/common/win_util.h @@ -211,6 +211,10 @@ void AdjustWindowToFit(HWND hwnd); void CenterAndSizeWindow(HWND parent, HWND window, const SIZE& pref, bool pref_is_client); +// Returns true if edge |edge| (one of ABE_LEFT, TOP, RIGHT, or BOTTOM) of +// monitor |monitor| has an auto-hiding taskbar. +bool EdgeHasAutoHideTaskbar(UINT edge, HMONITOR monitor); + // Duplicates a section handle from another process to the current process. // Returns the new valid handle if the function succeed. NULL otherwise. HANDLE GetSectionFromProcess(HANDLE section, HANDLE process, bool read_only); @@ -274,6 +278,9 @@ int MessageBox(HWND hwnd, // Returns the system set window title font. ChromeFont GetWindowTitleFont(); +// The thickness of an auto-hide taskbar in pixels. +extern const int kAutoHideTaskbarThicknessPx; + } // namespace win_util #endif // CHROME_COMMON_WIN_UTIL_H_ |