Bug 140935

Summary: [GTK] Resize the redirected XComposite window again after leaving accelerated compositing mode
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, commit-queue, gustavo, mrobinson, svillar, zan
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch svillar: review+

Description Carlos Garcia Campos 2015-01-27 06:32:37 PST
Since r178414 we don't resize the redirected XComposite window until we enter accelerated compositing mode, but after leaving it the redirected window keeps its size. We should resize to 1x1 again and free the XPixmap and cairo surface to save that memory.
Comment 1 Carlos Garcia Campos 2015-01-27 06:37:39 PST
Created attachment 245440 [details]
Patch
Comment 2 WebKit Commit Bot 2015-01-27 06:39:38 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Sergio Villar Senin 2015-01-29 02:18:39 PST
Comment on attachment 245440 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=245440&action=review

Awesome fix.

> Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:219
> +    XResizeWindow(m_display, m_window, std::max(1, size.width()), std::max(1, size.height()));

Perhaps a comment explaining that 0x0 windows are not allowed by X...

> Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:259
> +        std::max(1, m_size.width()), std::max(1, m_size.height())));

Ditto.

Orthogonal to this we should probably assert in ::surface() if we aren't in AC.
Comment 4 Carlos Garcia Campos 2015-01-29 23:29:23 PST
(In reply to comment #3)
> Comment on attachment 245440 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=245440&action=review
> 
> Awesome fix.

Thanks.

> > Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:219
> > +    XResizeWindow(m_display, m_window, std::max(1, size.width()), std::max(1, size.height()));
> 
> Perhaps a comment explaining that 0x0 windows are not allowed by X...

Sure.

> > Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:259
> > +        std::max(1, m_size.width()), std::max(1, m_size.height())));
> 
> Ditto.

I've realized we don't need this, since we are going to assert for empty sizes here.

> Orthogonal to this we should probably assert in ::surface() if we aren't in
> AC.

Sure.
Comment 5 Carlos Garcia Campos 2015-01-29 23:38:18 PST
Committed r179397: <http://trac.webkit.org/changeset/179397>