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 |