diff --git a/dom/plugins/PluginInstanceChild.cpp b/dom/plugins/PluginInstanceChild.cpp index 8cc0ea1a3a6..844da094244 100644 --- a/dom/plugins/PluginInstanceChild.cpp +++ b/dom/plugins/PluginInstanceChild.cpp @@ -144,9 +144,6 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface) , mPendingPluginCall(false) , mDoAlphaExtraction(false) , mSurfaceDifferenceRect(0,0,0,0) -#ifdef MOZ_X11 - , mFlash10Quirks(false) -#endif #if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6) , mMaemoImageRendering(PR_FALSE) #endif @@ -171,7 +168,9 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface) &description); if (description) { NS_NAMED_LITERAL_CSTRING(flash10Head, "Shockwave Flash 10."); - mFlash10Quirks = StringBeginsWith(nsDependentCString(description), flash10Head); + if (StringBeginsWith(nsDependentCString(description), flash10Head)) { + PluginModuleChild::current()->AddQuirk(PluginModuleChild::QUIRK_FLASH_EXPOSE_COORD_TRANSLATION); + } } #endif } @@ -2599,7 +2598,7 @@ PluginInstanceChild::PaintRectToSurface(const nsIntRect& aRect, nsIntRect plPaintRect(aRect); nsRefPtr renderSurface = aSurface; #ifdef MOZ_X11 - if (mIsTransparent && mFlash10Quirks) { + if (mIsTransparent && (GetQuirks() & PluginModuleChild::QUIRK_FLASH_EXPOSE_COORD_TRANSLATION)) { // Work around a bug in Flash up to 10.1 d51 at least, where expose event // top left coordinates within the plugin-rect and not at the drawable // origin are misinterpreted. (We can move the top left coordinate diff --git a/dom/plugins/PluginInstanceChild.h b/dom/plugins/PluginInstanceChild.h index 729eedf2639..833bf1d87df 100644 --- a/dom/plugins/PluginInstanceChild.h +++ b/dom/plugins/PluginInstanceChild.h @@ -503,10 +503,6 @@ private: // in plugin coordinates. nsIntRect mSurfaceDifferenceRect; -#ifdef MOZ_X11 - // Used with windowless flash plugin only, see bug 574583 - bool mFlash10Quirks; -#endif #if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6) // Maemo5 Flash does not remember WindowlessLocal state // we should listen for NPP values negotiation and remember it diff --git a/dom/plugins/PluginModuleChild.h b/dom/plugins/PluginModuleChild.h index 6bfc02903ad..f9685c1e2c9 100644 --- a/dom/plugins/PluginModuleChild.h +++ b/dom/plugins/PluginModuleChild.h @@ -221,6 +221,10 @@ public: QUIRK_FLASH_THROTTLE_WMUSER_EVENTS = 1 << 2, // Win32: Catch resets on our subclass by hooking SetWindowLong. QUIRK_FLASH_HOOK_SETLONGPTR = 1 << 3, + // X11: Work around a bug in Flash up to 10.1 d51 at least, where + // expose event top left coordinates within the plugin-rect and + // not at the drawable origin are misinterpreted. + QUIRK_FLASH_EXPOSE_COORD_TRANSLATION = 1 << 4, }; int GetQuirks() { return mQuirks; }