WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
changeset 2 303757a437d3
parent 0 4f2f89ce4247
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp	Fri Sep 17 09:02:29 2010 +0300
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp	Mon Oct 04 01:32:07 2010 +0300
@@ -4,7 +4,7 @@
  * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
  * Copyright (C) 2008 Collabora Ltd. All rights reserved.
  * Coypright (C) 2008 Holger Hans Peter Freyther
- * Coypright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
+ * Coypright (C) 2009, 2010 Girish Ramakrishnan <girish@forwardbias.in>
  *
  * All rights reserved.
  *
@@ -1461,7 +1461,19 @@
         Vector<String> values = paramValues;
         if (mimeType == "application/x-shockwave-flash") {
             QWebPageClient* client = m_webFrame->page()->d->client;
-            if (!client || !qobject_cast<QWidget*>(client->pluginParent())) {
+            const bool isQWebView = client && qobject_cast<QWidget*>(client->pluginParent());
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+            size_t wmodeIndex = params.find("wmode");
+            if (wmodeIndex == -1) {
+                // Disable XEmbed mode and force it to opaque mode
+                params.append("wmode");
+                values.append("opaque");
+            } else if (!isQWebView) {
+                // Disable transparency if client is not a QWebView
+                values[wmodeIndex] = "opaque";
+            }
+#else
+            if (!isQWebView) {
                 // inject wmode=opaque when there is no client or the client is not a QWebView
                 size_t wmodeIndex = params.find("wmode");
                 if (wmodeIndex == -1) {
@@ -1470,6 +1482,7 @@
                 } else
                     values[wmodeIndex] = "opaque";
             }
+#endif
         }
 
         RefPtr<PluginView> pluginView = PluginView::create(m_frame, pluginSize, element, url,