From cb657121eb11095f1e30e7d8289f4c1ba5df1fa1 Mon Sep 17 00:00:00 2001 From: "masayuki%d-toybox.com" Date: Sun, 18 Sep 2005 09:41:37 +0000 Subject: [PATCH] Bug 306209 Should fire NS_FOCUSCONTENT event on nsPluginInstanceOwner by clicking plugin's content patch by VYV03354@nifty.ne.jp r+sr=roc --- .../base/src/nsPluginNativeWindowWin.cpp | 20 +++++++++++++++++++ widget/src/windows/nsWindow.cpp | 10 ---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/modules/plugin/base/src/nsPluginNativeWindowWin.cpp b/modules/plugin/base/src/nsPluginNativeWindowWin.cpp index 773ec307e7c..77d3910a05d 100644 --- a/modules/plugin/base/src/nsPluginNativeWindowWin.cpp +++ b/modules/plugin/base/src/nsPluginNativeWindowWin.cpp @@ -52,6 +52,7 @@ #include "plevent.h" #include "nsIEventQueueService.h" +#include "nsGUIEvent.h" #include "nsIPluginInstancePeer.h" #include "nsIPluginInstanceInternal.h" @@ -286,6 +287,25 @@ static LRESULT CALLBACK PluginWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM enablePopups = PR_TRUE; break; + +#ifndef WINCE + case WM_MOUSEACTIVATE: { + // This seems to be the only way we're + // notified when a child window that doesn't have this handler proc + // (read as: windows created by plugins like Adobe Acrobat) + // has been activated via clicking. + // should be handled here because some plugins won't forward + // messages to original WinProc. + nsCOMPtr widget; + win->GetPluginWidget(getter_AddRefs(widget)); + if (widget) { + nsFocusEvent event(PR_TRUE, NS_PLUGIN_ACTIVATE, widget); + nsEventStatus status; + widget->DispatchEvent(&event, status); + } + } + break; +#endif } // Macromedia Flash plugin may flood the message queue with some special messages diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index a6bbfc34ef6..c9025b5b1d4 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -4521,16 +4521,6 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT break; #ifndef WINCE - case WM_MOUSEACTIVATE: - { - // This seems to be the only way we're - // notified when a child window that doesn't have this handler proc - // (read as: windows created by plugins like Adobe Acrobat) - // has been activated via clicking. - DispatchFocus(NS_PLUGIN_ACTIVATE, isMozWindowTakingFocus); - } - break; - case WM_WINDOWPOSCHANGING: { LPWINDOWPOS info = (LPWINDOWPOS) lParam;