Bug 618683 - Quirk the full screen focus fix landed in bug 608013 to silverlight. r=bsmedberg

This commit is contained in:
Jim Mathies 2011-07-26 14:18:23 -05:00
parent 0742b4d4cd
commit ebd858f280
3 changed files with 8 additions and 1 deletions

View File

@ -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;

View File

@ -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
}

View File

@ -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; }