summaryrefslogtreecommitdiffstats
path: root/win8/metro_driver
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-21 23:07:29 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-21 23:07:29 +0000
commit0d8cee35eb5b2be07bc447c1c4c77e3b0f408bb8 (patch)
tree81ccc4bb38d98aca065f7aeb30f23b1263013e9f /win8/metro_driver
parente48c9b2d0a56affdd3053d44e79d557d0e397e8e (diff)
downloadchromium_src-0d8cee35eb5b2be07bc447c1c4c77e3b0f408bb8.zip
chromium_src-0d8cee35eb5b2be07bc447c1c4c77e3b0f408bb8.tar.gz
chromium_src-0d8cee35eb5b2be07bc447c1c4c77e3b0f408bb8.tar.bz2
Don't attempt to delete and readd a duplicate hwnd in the SetFrameWindow notification in the metro driver.
This messes up the state maintained in the global window list which indicates whether the window was scrolled because of the OSK. BUG=150848 R=cpu Review URL: https://codereview.chromium.org/10964023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158109 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8/metro_driver')
-rw-r--r--win8/metro_driver/chrome_app_view.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/win8/metro_driver/chrome_app_view.cc b/win8/metro_driver/chrome_app_view.cc
index e2ec21a..0c93657 100644
--- a/win8/metro_driver/chrome_app_view.cc
+++ b/win8/metro_driver/chrome_app_view.cc
@@ -218,15 +218,18 @@ void SetFrameWindowInternal(HWND hwnd) {
::ShowWindow(current_top_frame, SW_HIDE);
}
- // If chrome opens a url in a foreground tab, it may call SetFrameWindow
- // again. Ensure that we don't have dups.
- globals.host_windows.remove_if([hwnd](std::pair<HWND, bool>& item) {
+ 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);
});
- globals.host_windows.push_front(std::make_pair(hwnd, false));
-
- AdjustFrameWindowStyleForMetro(hwnd);
+ if (index == globals.host_windows.end()) {
+ globals.host_windows.push_front(std::make_pair(hwnd, false));
+ AdjustFrameWindowStyleForMetro(hwnd);
+ } else {
+ SetForegroundWindow(hwnd);
+ }
}
void CloseFrameWindowInternal(HWND hwnd) {
@@ -900,13 +903,17 @@ HRESULT ChromeAppView::OnActivate(winapp::Core::ICoreApplicationView*,
DVLOG(1) << "CoreWindow found: " << std::hex << globals.core_window;
if (!globals.host_thread) {
+ DWORD chrome_ui_thread_id = 0;
globals.host_thread =
- ::CreateThread(NULL, 0, HostMainThreadProc, NULL, 0, NULL);
+ ::CreateThread(NULL, 0, HostMainThreadProc, NULL, 0,
+ &chrome_ui_thread_id);
if (!globals.host_thread) {
NOTREACHED() << "thread creation failed.";
return E_UNEXPECTED;
}
+
+ ::AttachThreadInput(chrome_ui_thread_id, globals.main_thread_id, TRUE);
}
if (RegisterHotKey(globals.core_window, kFlipWindowsHotKeyId,