Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(776)

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 626183002: Fix a long standing bug with the browser window losing focus when the user scrolled on the page usi… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review comments Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/hwnd_message_handler.cc
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index ae24d047e5c7bb0e5f666297e1ad87242ec4625c..744b9eaddbc86a767316af0ed032e9b54c89fb33 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -1549,8 +1549,15 @@ LRESULT HWNDMessageHandler::OnMouseActivate(UINT message,
POINT cursor_pos = {0};
::GetCursorPos(&cursor_pos);
::ScreenToClient(hwnd(), &cursor_pos);
+ // The code below exists for child windows like NPAPI plugins etc which need
+ // to be activated whenever we receive a WM_MOUSEACTIVATE message. Don't put
+ // transparent child windows in this bucket as they are not supposed to grab
+ // activation.
+ // TODO(ananta)
+ // Get rid of this code when we deprecate NPAPI plugins.
HWND child = ::RealChildWindowFromPoint(hwnd(), cursor_pos);
- if (::IsWindow(child) && child != hwnd() && ::IsWindowVisible(child))
+ if (::IsWindow(child) && child != hwnd() && ::IsWindowVisible(child) &&
+ !(::GetWindowLong(child, GWL_EXSTYLE) & WS_EX_TRANSPARENT))
PostProcessActivateMessage(WA_INACTIVE, false);
// TODO(beng): resolve this with the GetWindowLong() check on the subsequent
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698