Skip to content

Commit

Permalink
In Chrome metro mode we need to ensure that windows currently visible…
Browse files Browse the repository at this point in the history
… 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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159374 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
ananta@chromium.org committed Sep 29, 2012
1 parent 621de9f commit 59b9a62
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions win8/metro_driver/chrome_app_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 59b9a62

Please sign in to comment.