diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-01 19:27:27 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-01 19:27:27 +0000 |
commit | b1f9afc247020b7d431124b476989f4608189b16 (patch) | |
tree | b342233d41e2892a44c55c669c2a1f66840515aa | |
parent | b49ca3e294d705e5202bc05c1f774c507e26613b (diff) | |
download | chromium_src-b1f9afc247020b7d431124b476989f4608189b16.zip chromium_src-b1f9afc247020b7d431124b476989f4608189b16.tar.gz chromium_src-b1f9afc247020b7d431124b476989f4608189b16.tar.bz2 |
Merge 159374 - In Chrome metro mode we need to ensure that windows currently visible in metro mode are at the top of the
window list maintained by the metro driver. This regressed with my change to fix the OSK scrolling bug:
http://code.google.com/p/chromium/issues/detail?id=150848
BUG=150848
R=cpu
Review URL: https://codereview.chromium.org/11014005
TBR=ananta@chromium.org
Review URL: https://chromiumcodereview.appspot.com/11040004
git-svn-id: svn://svn.chromium.org/chrome/branches/1271/src@159535 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | win8/metro_driver/chrome_app_view.cc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/win8/metro_driver/chrome_app_view.cc b/win8/metro_driver/chrome_app_view.cc index f926f28..abac4b5 100644 --- a/win8/metro_driver/chrome_app_view.cc +++ b/win8/metro_driver/chrome_app_view.cc @@ -218,16 +218,28 @@ void SetFrameWindowInternal(HWND hwnd) { ::ShowWindow(current_top_frame, SW_HIDE); } + // Visible frame windows always need to be at the head of the list. + // Check if the window being shown already exists in our global list. + // If no then add it at the head of the list. + // If yes, retrieve the osk window scrolled state, remove the window from the + // list and readd it at the head. std::list<std::pair<HWND, bool> >::iterator index = std::find_if(globals.host_windows.begin(), globals.host_windows.end(), [hwnd](std::pair<HWND, bool>& item) { return (item.first == hwnd); }); - if (index == globals.host_windows.end()) { - globals.host_windows.push_front(std::make_pair(hwnd, false)); - AdjustFrameWindowStyleForMetro(hwnd); + bool window_scrolled_state = false; + bool new_window = (index == globals.host_windows.end()); + if (!new_window) { + window_scrolled_state = index->second; + globals.host_windows.erase(index); } + + globals.host_windows.push_front(std::make_pair(hwnd, window_scrolled_state)); + + if (new_window) + AdjustFrameWindowStyleForMetro(hwnd); } void CloseFrameWindowInternal(HWND hwnd) { |