[Webkit-unassigned] [Bug 18831] [GTK] support windowless plugins

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 10 03:53:20 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=18831





--- Comment #26 from Benjamin Otte <otte at gnome.org>  2009-11-10 03:53:17 PDT ---
(In reply to comment #24)
> > +        if (m_drawable)
> > +            XFreePixmap(GDK_DISPLAY(), m_drawable);
> > +
> > +        m_drawable = XCreatePixmap(GDK_DISPLAY(), GDK_DRAWABLE_XID(parentWindow->window),
> > +                                   m_windowRect.width(), m_windowRect.height(),
> > +                                   ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth);
> > +        XSync(GDK_DISPLAY(), False); // make sure that the server knows about the Drawable
> > +    }
> 
> Excuse my ignorance of X programming, but why do we need a sync here?
>
It ensures that all previous operations have completed on the server. In this
particular case, as the comment says, it ensures that the server has created
the pixmap.
This is important when there are multiple X connections (aka displays) in use
that can access this resource. In that case the other display could try to do
an operation on that resource while the server doesn't know about it. That
would cause an error, and due to the gorgeous error handling of X, would cause
an abort of the application.

Now that's the theory. In practice, I suspect it's copied from the Qt port
which does indeed use two different displays and Brian forgot to delete it when
porting to gtk.

> > +    exposeEvent.width = exposedRect.x() + exposedRect.width(); // flash bug? it thinks width is the right in transparent mode
> > +    exposeEvent.height = exposedRect.y() + exposedRect.height(); // flash bug? it thinks height is the bottom in transparent mode
> 
> I don't understand these comments. You mean it thinks height is the absolute y
> position? Will this break other plugins?
>
I'd like a proof that Mozilla does this the same way. Otherwise I suspect it
shadows a different bug.
Also, I know Swfdec doesn't treat it this way.

> I recommend taking the parens out here, they do not add anything.
> 
I like it when people add () to function names as that makes it very clear it's
talking about a function (in code comments as well as email or irc). YMMV of
course.

-- 
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