[Webkit-unassigned] [Bug 30170] New: Qt Plugins : Remove usage of winId()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 7 09:20:02 PDT 2009


           Summary: Qt Plugins : Remove usage of winId()
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebKit Qt
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: girish at forwardbias.in

Currently, the code uses winId() of QWebPageClient in many places. 

This is a bug for two reasons:
1. Everytime we use winId(), we end up creating a native widget (which in turn
disables content propagation).
2. Neither windowed nor windowless plugins require the winId of the QWebView or

The only requirement AFAIK for plugins from the QWebPageClient are:
1. Provide the window id
2. Provide QWidget * to QGraphicsView or QWebView. This is needed for the
parent of the QX11EmbedContainer (windowed mode) and in PopupMenu's parent.

I discussed this with Kenneth over irc. We have two approaches:
1. Replace winId with windowId. We always return the id of the window (i.e top
level widget).
2. Replace winId with pluginWidget(). pluginWidget returns a QWidget* - either
QWebView or QGraphicsView. (fn name debatable)

We decided on approach 1 on irc, because Kenneth said we were moving away from
QWidget based code (I am not sure, but I took it at face value :)). However,
when trying it, I have found that there are situations when we really really
the QWidget* (In PlatformScreenQt.cpp and PopupMenuQt.cpp). I have marked them
as "####" in attached patch. We cannot use pluginParent() in those situations.
pluginParent() returns the QGraphicsWebView or the QWebView. So, to get to the
window, we have to end up writing code like:

    QObject *pp = client->pluginParent();
    if (QWidget *w = qobject_cast<QWidget *>(pp)) {
        windowId = w->window()->winId();
    } else if (QGraphicsWebView *v = qobject_cast<QGraphicsWebView *>(pp)) {
        QGraphicsView *view = v->views().value(0);
        if (view)
            windowId = view->window()->winId();

I have gone ahead and also tried approach 2. Seems to work, attached.

What do you think?

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list