Bug 140935 - [GTK] Resize the redirected XComposite window again after leaving accelerated compositing mode
Summary: [GTK] Resize the redirected XComposite window again after leaving accelerated...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2015-01-27 06:32 PST by Carlos Garcia Campos
Modified: 2015-01-29 23:38 PST (History)
6 users (show)

See Also:


Attachments
Patch (7.32 KB, patch)
2015-01-27 06:37 PST, Carlos Garcia Campos
svillar: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>