diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp index 9fa4467afd4..ba1530e832f 100644 --- a/dom/plugins/ipc/PluginInstanceChild.cpp +++ b/dom/plugins/ipc/PluginInstanceChild.cpp @@ -2003,7 +2003,9 @@ PluginInstanceChild::AnswerSetPluginFocus() // when a button click brings up a full screen window. Since we send // this in response to a WM_SETFOCUS event on our parent, the parent // should have focus when we receive this. If not, ignore the call. - if (::GetFocus() == mPluginWindowHWND || ::GetFocus() != mPluginParentHWND) + if (::GetFocus() == mPluginWindowHWND || + ((GetQuirks() & PluginModuleChild::QUIRK_SILVERLIGHT_FOCUS_CHECK_PARENT) && + (::GetFocus() != mPluginParentHWND))) return true; ::SetFocus(mPluginWindowHWND); return true; diff --git a/dom/plugins/ipc/PluginModuleChild.cpp b/dom/plugins/ipc/PluginModuleChild.cpp index f437b352dad..42001201ac9 100644 --- a/dom/plugins/ipc/PluginModuleChild.cpp +++ b/dom/plugins/ipc/PluginModuleChild.cpp @@ -1910,6 +1910,7 @@ PluginModuleChild::InitQuirksModes(const nsCString& aMimeType) mQuirks |= QUIRK_SILVERLIGHT_DEFAULT_TRANSPARENT; #ifdef OS_WIN mQuirks |= QUIRK_WINLESS_TRACKPOPUP_HOOK; + mQuirks |= QUIRK_SILVERLIGHT_FOCUS_CHECK_PARENT; #endif } diff --git a/dom/plugins/ipc/PluginModuleChild.h b/dom/plugins/ipc/PluginModuleChild.h index 1c7b555a570..9252eff9644 100644 --- a/dom/plugins/ipc/PluginModuleChild.h +++ b/dom/plugins/ipc/PluginModuleChild.h @@ -294,6 +294,10 @@ public: // Win: QuickTime steals focus on SetWindow calls even if it's hidden. // Avoid calling SetWindow in that case. QUIRK_QUICKTIME_AVOID_SETWINDOW = 1 << 7, + // Win: Check to make sure the parent window has focus before calling + // set focus on the child. Addresses a full screen dialog prompt + // problem in Silverlight. + QUIRK_SILVERLIGHT_FOCUS_CHECK_PARENT = 1 << 8, }; int GetQuirks() { return mQuirks; }