[Webkit-unassigned] [Bug 140352] REGRESSION(r177075): Flickering when the WebView is realized

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 12 09:27:10 PST 2015


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

--- Comment #4 from Carlos Garcia Campos <cgarcia at igalia.com> ---
(In reply to comment #3)
> Comment on attachment 244437 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=244437&action=review
> 
> > Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:323
> > +        GdkVisual* visual = gdk_window_get_visual(parentWindow);
> >          priv->redirectedWindow = RedirectedXCompositeWindow::create(
> >              GDK_DISPLAY_XDISPLAY(display),
> > -            parentWindow ? GDK_WINDOW_XID(parentWindow) : 0,
> > -            IntSize(1, 1),
> > +            GDK_VISUAL_XVISUAL(visual),
> > +            gdk_visual_get_depth(visual),
> 
> You are no longer handling the null parentWindow case here?

hmm, widgets must be inside a toplevel window (or be a toplevel) before being realized. I'll check if this causes problems with uwing a web view inside a popup window, for example.

> > Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:131
> > -std::unique_ptr<RedirectedXCompositeWindow> RedirectedXCompositeWindow::create(Display* display, Window parent, const IntSize& size, std::function<void()> damageNotify)
> > +std::unique_ptr<RedirectedXCompositeWindow> RedirectedXCompositeWindow::create(Display* display, Visual* visual, int depth, std::function<void()> damageNotify)
> >  {
> > -    return supportsXDamageAndXComposite(display) ? std::unique_ptr<RedirectedXCompositeWindow>(new RedirectedXCompositeWindow(display, parent, size, damageNotify)) : nullptr;
> > +    return supportsXDamageAndXComposite(display) ? std::unique_ptr<RedirectedXCompositeWindow>(new RedirectedXCompositeWindow(display, visual, depth, damageNotify)) : nullptr;
> 
> I think we don't need to change the arguments here. You can get a window's
> visual and depth using XGetWindowAttributes.

Yes, but GTK+ keeps a internal list of GdkVisuals, so gdk_window_get_visual() and gdk_visual_get_depth() are just a simple return, we don't need to query the xwindow again.

> > Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:152
> > +    // CWBorderPixel must be present when the depth doesn't match the parent's one.
> > +    // See http://cgit.freedesktop.org/xorg/xserver/tree/dix/window.c?id=xorg-server-1.16.0#n703.
> > +    windowAttributes.border_pixel = 0;
> 
> Why does the depth not match the parent's depth?

The root window might have a 24 (which I think it's the default). When rgba visual has been explicitly set in the widget (to use transparencies), the depth is 32 and doesn't match the root window (24).

> > Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:155
> > -        parent ? parent : RootWindowOfScreen(screen),
> > +        RootWindowOfScreen(screen),
> 
> Is there really no way to do this without properly parenting the window?

This is properly parenting the window. We want a window whose parent is the root window. We are using the web view parent window as parent only to inherit the visual, colormap and depth values, and then reparenting to the root window. This patch uses the proper parent directly, passing the visual, colormap and depth desired, instead of using another window just to inherit the values and then having to reparent. The reparent is causing the flash effect.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150112/18ba82eb/attachment-0002.html>


More information about the webkit-unassigned mailing list