Bug 159463

Summary: [GTK] Avoid the redirected window resize when the view is realized in AC mode
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, bugs-noreply, commit-queue, gustavo, mcatanzaro, mrobinson, yoon, zan
Priority: P2 Keywords: Gtk
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 154066, 159455    
Attachments:
Description Flags
Patch mcatanzaro: review+

Description Carlos Garcia Campos 2016-07-06 05:07:23 PDT
We are always creating the redirected window at 1x1 and then resizing it if we are in AC mode. When the view is realized and AC mode is already enabled, which happens for example when AC mode is forced, or when the threaded compositor is enabled, we could just pass the initial size to the redirected window constructor to create the XWindow at the right size.
Comment 1 Carlos Garcia Campos 2016-07-06 05:13:07 PDT
Created attachment 282881 [details]
Patch
Comment 2 WebKit Commit Bot 2016-07-06 05:14:59 PDT
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 WebKit Commit Bot 2016-07-06 05:15:07 PDT
Attachment 282881 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.h:48:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.h:56:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 2 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Michael Catanzaro 2016-07-20 17:18:44 PDT
Comment on attachment 282881 [details]
Patch

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

> Source/WebKit2/ChangeLog:18
> +        WebPageProxy the redirected window has access to the devide scale factor and view widget to get the parent

device

> Source/WebKit2/ChangeLog:26
> +        (WebKit::RedirectedXCompositeWindow::~RedirectedXCompositeWindow): Deleted.

prepare-ChangeLog bug

> Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:140
> +    return std::unique_ptr<RedirectedXCompositeWindow>(new RedirectedXCompositeWindow(webPage, initialSize, WTFMove(damageNotify)));

Since you modified this line anyway, change it to use std::make_unique while you're at it, please. Using new outside of a create function is not OK anymore.
Comment 5 Carlos Garcia Campos 2016-07-21 00:04:51 PDT
(In reply to comment #4)
> Comment on attachment 282881 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=282881&action=review
> 
> > Source/WebKit2/ChangeLog:18
> > +        WebPageProxy the redirected window has access to the devide scale factor and view widget to get the parent
> 
> device
> 
> > Source/WebKit2/ChangeLog:26
> > +        (WebKit::RedirectedXCompositeWindow::~RedirectedXCompositeWindow): Deleted.
> 
> prepare-ChangeLog bug
> 
> > Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:140
> > +    return std::unique_ptr<RedirectedXCompositeWindow>(new RedirectedXCompositeWindow(webPage, initialSize, WTFMove(damageNotify)));
> 
> Since you modified this line anyway, change it to use std::make_unique while
> you're at it, please. Using new outside of a create function is not OK
> anymore.

This is the create() function and the constructor is private.
Comment 6 Carlos Garcia Campos 2016-07-21 00:06:05 PDT
Committed r203495: <http://trac.webkit.org/changeset/203495>