<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>31232</bug_id>
          
          <creation_ts>2009-11-07 15:50:59 -0800</creation_ts>
          <short_desc>[Qt] Windowed Plugins : Implement composited plugins for windowed mode</short_desc>
          <delta_ts>2014-02-03 03:15:55 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Plug-ins</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt, QtTriaged</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>24157</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Girish Ramakrishnan">girish</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>girish</cc>
    
    <cc>hausmann</cc>
    
    <cc>kent.hansen</cc>
    
    <cc>laszlo.gombos</cc>
    
    <cc>mark.renouf</cc>
    
    <cc>tofu.linden</cc>
    
    <cc>tonikitoo</cc>
    
    <cc>zcrendel</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>161382</commentid>
    <comment_count>0</comment_count>
    <who name="Girish Ramakrishnan">girish</who>
    <bug_when>2009-11-07 15:50:59 -0800</bug_when>
    <thetext>Currently, flash does not display in QWebGraphicsView since it&apos;s in windowed mode. This is solved by using composite extension for windowed mode.

Fennec patch - https://bugzilla.mozilla.org/show_bug.cgi?id=442109

Pure Qt implementation - http://git.forwardbias.in/?p=webkit/xembedoffscreen.git;a=summary</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>161986</commentid>
    <comment_count>1</comment_count>
    <who name="Girish Ramakrishnan">girish</who>
    <bug_when>2009-11-10 01:22:00 -0800</bug_when>
    <thetext>I have a working implementation outside WebKit: http://git.forwardbias.in/?p=webkit/xembedoffscreen.git;a=summary. Events don&apos;t work only with flash (works with Qt and Gtk widgets), not sure why.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>162084</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Renouf">mark.renouf</who>
    <bug_when>2009-11-10 10:15:03 -0800</bug_when>
    <thetext>Can someone describe in a bit more detail what this bug seeks to implement, vs. what has been implemented in #18831 ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>162103</commentid>
    <comment_count>3</comment_count>
    <who name="Girish Ramakrishnan">girish</who>
    <bug_when>2009-11-10 10:38:21 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; Can someone describe in a bit more detail what this bug seeks to implement, vs.
&gt; what has been implemented in #18831 ?

Sure.

Flash (Netscape plugins really) works in two modes - windowed and windowless. In the windowed mode, it expects a native window. In the windowless mode, it can draw itself into a pixmap. By default, the mode is windowed. One needs to use wmode=transparent or opaque (Flash specific) to make it windowless.

Whether the browser displays a plugin in windowed or windowless mode is a decision made by the plugin. It cannot be enforced by the browser (In theory, a browser can advertise only windowless mode but this causes Flash to crash).

In Qt, we have two different &apos;webkit&apos; views 
1. QWebView, a widget. It is possible to XEmbed into a QWebView. 
2. We also have a QGraphicsWebView - this is an item in a 2d scene (QGraphicsScene). Items can be transformed. So, it&apos;s not possible to use XEmbed in this case. As a result, we only support windowless mode in a QGraphicsWebView.

Now to the problem - When using youtube, the flash content enforces windowed mode. As a result, youtube videos don&apos;t appear in QGraphicsWebView.

Solutions: 
1. We can either use XComposite/XDamage to get the contents of the plugin into a Picture and render it into the QGraphicsWebView. (This bug addresses this solution). (This approach is used in Fennec)
2. Inject wmode=transparent or similar into the dom/pass it to the plugin when instantiating it. Since, we support windowless mode, youtube will appear in the QGraphicsWebView.

We haven&apos;t decided yet which of the above is &apos;elegant&apos;. This is still research.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>162181</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2009-11-10 12:59:33 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; I have a working implementation outside WebKit:
&gt; http://git.forwardbias.in/?p=webkit/xembedoffscreen.git;a=summary. Events don&apos;t
&gt; work only with flash (works with Qt and Gtk widgets), not sure why.

That&apos;s surprisingly few lines of code - nice :)

Wrt the events: Currently you&apos;re sending the events via XSendEvent. Given flash&apos;s use of Gtk I would assume that Gtk/Gdk receives the events and passes them on to Flash as GdkEvents. It seems they get stuck somewhere, right?

What you could try is the following: Instead of the round trip to the X server and the translation through Gtk/Gdk, what happens if you send the events &quot;directly&quot; just like you would send them to a windowless plugin? It might be quicker and with a bit of luck it might work, too ;-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>162330</commentid>
    <comment_count>5</comment_count>
    <who name="Girish Ramakrishnan">girish</who>
    <bug_when>2009-11-10 20:34:10 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; What you could try is the following: Instead of the round trip to the X server
&gt; and the translation through Gtk/Gdk, what happens if you send the events
&gt; &quot;directly&quot; just like you would send them to a windowless plugin? It might be
&gt; quicker and with a bit of luck it might work, too ;-)

Ah, brilliant suggestion as always. This actually works. Just pushed a change to my git repo. So, I will try merging to webkit now.

Since, the code is very different from the embed container code, I am thinking we will add this as a separate file PluginCompositedQt.[cpp|h]. This also makes it easy to ifdef out the whole thing. To start with, we can make PluginComposited a WebCore Widget but in the long run, I guess we can remove it too. In fact, we should be able to reuse (in theory) the windowless event dispatching and the composited mode event dispatching. I have to check if refactoring that portion is worth the lesser readability though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>162445</commentid>
    <comment_count>6</comment_count>
    <who name="Girish Ramakrishnan">girish</who>
    <bug_when>2009-11-11 04:50:56 -0800</bug_when>
    <thetext>http://gitorious.org/~girish/qtwebkit/girishs-clone/commits/composited_plugins has a half-broken implementation, but youtube can now be flipped in QGVLauncher :-)

I am going to disappear for a while (am working on this on my own time), I will be back next week. If someone feels like cleaning it up ping me on irc (girishr).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>162448</commentid>
    <comment_count>7</comment_count>
    <who name="Girish Ramakrishnan">girish</who>
    <bug_when>2009-11-11 05:00:39 -0800</bug_when>
    <thetext>Here&apos;s an (incomplete) TODO list:
1. Check if we can just use QWidget::x11Event instead of converting Qt events.
2. Fix Event handling
3. Track old event filters
4. Transparent plugins does not work yet
5. We can just make PluginCompositedQt a QX11EmbedContainer

Unfixable/Don&apos;t know how to handle cases below:
1. Popups shown by plugin
2. Cursor changes by plugin
3. Dialogs shown by plugin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>167930</commentid>
    <comment_count>8</comment_count>
    <who name="Girish Ramakrishnan">girish</who>
    <bug_when>2009-12-02 01:58:20 -0800</bug_when>
    <thetext>Per my understanding, the approach of using xcomposite was chosen by fennec, only because they didn&apos;t have flash 10 on ARM (flash 10 added support for windowless mode). 

See https://bugzilla.mozilla.org/show_bug.cgi?id=442109#c10 and https://bugzilla.mozilla.org/show_bug.cgi?id=442109#c11</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>167932</commentid>
    <comment_count>9</comment_count>
    <who name="Girish Ramakrishnan">girish</who>
    <bug_when>2009-12-02 01:59:27 -0800</bug_when>
    <thetext>See also #32059</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>170753</commentid>
    <comment_count>10</comment_count>
    <who name="Girish Ramakrishnan">girish</who>
    <bug_when>2009-12-11 07:35:37 -0800</bug_when>
    <thetext>There&apos;s a Qt3 based composite implementation.
http://ktown.kde.org/~fredrik/compositewrapper.cpp
http://ktown.kde.org/~fredrik/compositewrapper.cpp</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>198072</commentid>
    <comment_count>11</comment_count>
    <who name="Tor Arne Vestbø">vestbo</who>
    <bug_when>2010-03-10 06:37:38 -0800</bug_when>
    <thetext>
Please follow the QtWebKit bug reporting guidelines when reporting bugs.

See http://trac.webkit.org/wiki/QtWebKitBugs

Specifically:

  - The &apos;QtWebKit&apos; component should only be used for bugs/features in the
    public QtWebKit API layer, not to signify that the bug is specific to
    the Qt port of WebKit

      http://trac.webkit.org/wiki/QtWebKitBugs#Component

  - Add the keyword &apos;Qt&apos; to signal that it&apos;s a Qt-related bug

      http://trac.webkit.org/wiki/QtWebKitBugs#Keywords</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>792159</commentid>
    <comment_count>12</comment_count>
    <who name="Mozhaev Grigory">zcrendel</who>
    <bug_when>2012-12-15 11:55:26 -0800</bug_when>
    <thetext>Still no implementation in QtWebkit for this bug, no flash in any videos of  www.bbc.co.uk</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>975096</commentid>
    <comment_count>13</comment_count>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2014-02-03 03:15:55 -0800</bug_when>
    <thetext>=== Bulk closing of Qt bugs ===

If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary.

If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>