Bug 35683 - [Qt] QWebView Transparency fails when Flash Plugin is initialized under Ubuntu 9.04 & 9.10
Summary: [Qt] QWebView Transparency fails when Flash Plugin is initialized under Ubunt...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords: Qt
Depends on:
Blocks: 35962
  Show dependency treegraph
 
Reported: 2010-03-03 07:14 PST by Tor Arne Vestbø
Modified: 2010-04-26 04:03 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tor Arne Vestbø 2010-03-03 07:14:42 PST
This bug report originated from issue QTBUG-5144
http://bugreports.qt.nokia.com/browse/QTBUG-5144

--- Description ---

When a webview is set transparent, normal html content will be displayed on a transparent background. Once a flash player instance is loaded in the webview the transparency of the flash content is preserved, but the webview will not be transparent anymore. The Application output also throws an error:

<p>(&lt;unknown&gt;:3122): Gdk-CRITICAL **: gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)' failed</p>

<p>This bug seems only to be Linux specific since it does not appear under windows or mac osx. This bug has been reproduced under Ubuntu 9.04 and 9.10 with Qt 4.5.3 aswell as 4.6.0 beta 1.</p>

<p>&#8212; Example Code</p>

<p>QWebView *webView = new QWebView();<br/>
webView-&gt;settings()-&gt;setAttribute(QWebSettings::PluginsEnabled, true);</p>

<p>webView-&gt;setFixedSize(500,500);<br/>
webView-&gt;setWindowFlags(Qt::FramelessWindowHint);</p>

<p>QPalette palette = webView-&gt;palette();<br/>
palette.setBrush(QPalette::Base, Qt::transparent);<br/>
webView-&gt;page()-&gt;setPalette(palette);<br/>
webView-&gt;setAttribute(Qt::WA_OpaquePaintEvent, false);<br/>
webView-&gt;setAttribute(Qt::WA_TranslucentBackground, true);</p>

<p>QString filePath = "mySWF.swf";<br/>
QString applicationName = "myExample";</p>

<p>QString htmlTemplate = QString( "&lt;html&gt;"<br/>
                                "&lt;body style =\"margin: 0 0 0 0;\" &gt;"<br/>
                                "&lt;object&gt;"<br/>
                                "	&lt;embed "<br/>
                                "		src = \"%1\" "<br/>
                                "		name = \"%2\" "<br/>
                                "		flashvars = \"apppath=%3\" "<br/>
                                "		width = \"500\" "<br/>
                                "		height = \"500\" "<br/>
                                "		menu = \"true\" "<br/>
                                "		quality = \"best\" "<br/>
                                //"		bgcolor = \"#666666\""<br/>
                                "		seamlesstabbing = \"true\" "<br/>
                                "		wmode = \"transparent\"" // window, opaque, transparent, direct, gpu<br/>
                                "		allowfullscreen = \"true\""<br/>
                                "		allowscriptaccess = \"always\""<br/>
                                "		allownetworking = \"all\""<br/>
                                "		type=\"application/x-shockwave-flash\"&gt; "<br/>
                                "	&lt;/embed&gt;"<br/>
                                "&lt;/object&gt; "<br/>
                                "&lt;/body&gt;&lt;/html&gt;")<br/>
                                .arg(filePath)<br/>
                                .arg(QApplication::applicationDirPath())<br/>
                                .arg(applicationName);</p>

<p>webView-&gt;setWindowTitle(applicationName);<br/>
webView-&gt;setHtml(htmlTemplate);<br/>
webView-&gt;show();</p>
Comment 1 Kent Hansen 2010-03-17 08:04:49 PDT
(K)ubuntu 9.10, r55986, Qt 4.7:

(process:12843): Gtk-CRITICAL **: gtk_clipboard_get_for_display: assertion `display != NULL' failed
Adobe Flash Player: gtk_clipboard_get(GDK_SELECTION_PRIMARY); failed. Trying to call gtk_init(0,0);

and then a white view. No transparency. Same with 4.6.

WebKit shipped with Qt 4.5:

(process:12965): Gtk-CRITICAL **: gtk_clipboard_get_for_display: assertion `display != NULL' failed
Adobe Flash Player: gtk_clipboard_get(GDK_SELECTION_PRIMARY); failed. Trying to call gtk_init(0,0);

(<unknown>:12965): Gdk-CRITICAL **: gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)' failed

and then a black view. No transparency.

On Mac I don't see anything with r55986 & 4.7.
Comment 2 Simon Hausmann 2010-03-17 15:58:14 PDT
I think this is a WONTFIX ;(

If I understand/guess correctly ;) then the WebView will get backed up by an X11 window - due to the windowed x11embed'ed plugin. At that point there's no transparency unless you have ARGB visuals.
Comment 3 Jocelyn Turcotte 2010-04-26 04:03:17 PDT
Resolving as won't fix.