From 4395e7ccdc3052368fb326110e2aec00645c3206 Mon Sep 17 00:00:00 2001 From: "masayuki%d-toybox.com" Date: Wed, 1 Feb 2006 15:37:04 +0000 Subject: [PATCH] Bug 323142 Selecting from drop down in Java applet no longer populates field. patch by Masatoshi Kimura (emk) r=ere, sr=roc git-svn-id: svn://10.0.0.236/trunk@188665 18797224-902f-48f8-a5cc-f745e15eee43 --- .../base/src/nsPluginNativeWindowWin.cpp | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/mozilla/modules/plugin/base/src/nsPluginNativeWindowWin.cpp b/mozilla/modules/plugin/base/src/nsPluginNativeWindowWin.cpp index d85cb36e447..5a8e888fd1a 100644 --- a/mozilla/modules/plugin/base/src/nsPluginNativeWindowWin.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginNativeWindowWin.cpp @@ -292,18 +292,25 @@ static LRESULT CALLBACK PluginWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM #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); + // If a child window of this plug-in is already focused, + // don't focus the parent to avoid focus dance. + // The following WM_SETFOCUS message will give the focus + // to the appropriate window anyway. + HWND focusedWnd = ::GetFocus(); + if (!::IsChild((HWND)win->window, focusedWnd)) { + // 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;