Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QWebEngine: Resizing window is sluggish #405

Open
JuBan1 opened this issue Mar 21, 2017 · 13 comments

Comments

Projects
4 participants
@JuBan1
Copy link
Collaborator

commented Mar 21, 2017

Resizing the Nqq windows under WebKit is buttery smooth for me. But resizing under WebEngine is not smooth at all probably because the WebView's resize operation takes too long.

Here's how it looks like mid-drag:

image

I looked around a bit and a possible solution is to handle the resize event on our own. During a resizing event, instead of letting the WebView resize, we just rescale it. When the resizing event ends, we resize WebView once.

@Teklad

This comment has been minimized.

Copy link
Collaborator

commented Mar 21, 2017

I disable update contents while resizing so I never noticed this. Lol

@Teklad

This comment has been minimized.

Copy link
Collaborator

commented Mar 27, 2017

Okay, so this issue is due to OpenGL being behind the scenes rendering QWebEngine. Resizing an OpenGL context is an extremely expensive operation (and verified slow when using the Nvidia drivers). Also, this behavior seems to be consistent with my experience running Chrome as my web browser, so until it's fixed in upstream we'll just have to deal with it.

@JuBan1 JuBan1 referenced this issue Mar 20, 2018

Closed

QtWebEngine transition (again, but with a plan) #572

4 of 4 tasks complete
@danieleds

This comment has been minimized.

Copy link
Member

commented Mar 21, 2018

@danieleds

This comment has been minimized.

Copy link
Member

commented Mar 21, 2018

On the anniversary of this issue...

I looked around a bit and a possible solution is to handle the resize event on our own. During a resizing event, instead of letting the WebView resize, we just rescale it. When the resizing event ends, we resize WebView once.

This would be weird but still better than a white empty border.

Or wait, some cool design is coming to my mind.

Imagine that, while resizing, we rescale the WebView but we also make it opaque and show the number of visible text rows/columns over it. Something like this 2-minutes mockup, but better:

notepadqq2

This would remove the resize ugliness AND be useful, by giving real-time information on the number of rows and columns.

@Teklad

This comment has been minimized.

Copy link
Collaborator

commented Apr 1, 2018

@danieleds I just looked at the new webengine branch and its coming along nicely... I'll look into getting this done for the branch since I FINALLY have some free time.

@danieleds

This comment has been minimized.

Copy link
Member

commented Apr 1, 2018

Perfect!

The webengine branch still has its problems... but at least it's working without any major modification.
Right now I'm struggling with some crashes, a weird problem on startup and another weirdness with high-frequency messages. Your feedback on these issues would be useful too.

@Teklad

This comment has been minimized.

Copy link
Collaborator

commented Apr 1, 2018

I believe I remember having a similar issue with crashes (especially when exiting notepadqq). I think it has something to do with messages getting queued up but never processed iirc. Let me dig through my massive pile of webs and see if I can figure out.

@Teklad

This comment has been minimized.

Copy link
Collaborator

commented Apr 8, 2018

So to update on this... I've looked into it a bit. Basically its probably "do-able", but due to how QWebEngine is in its current state we'd be relying on some rather undocumented back-end QT things that could break between versions to get it done.

I'm more than happy to give it a go anyways if you want but this definitely needs to be fixed upstream for any kind of permanent relief. Unfortunately the issue was reported upstream over a year ago without any fix in sight currently.

@JuBan1

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 8, 2018

I think backend shenanigans like that ought to be avoided. Especially with QWebEngine since it's a somewhat newer part of Qt so chances are that its internals have changed not too long ago.

We can looks for a nice visual to hide the sluggish resize once the webengine branch is actually working. That should take priority.

@danieleds

This comment has been minimized.

Copy link
Member

commented Apr 8, 2018

I totally agree with JuBan

@echostorm

This comment has been minimized.

Copy link

commented Jun 15, 2018

Just wondering if this ever got solved by now? since im facing same problem with webengine with two of my browser projects any proper solution for this with Qt 5.11...

@JuBan1

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 15, 2018

@echostorm Still happening, and I think it's very unlikely to be fixed any time soon.

@Teklad

This comment has been minimized.

Copy link
Collaborator

commented Dec 13, 2018

Just a note, though hopefully unimportant in the coming months... this bug has been fixed in upstream:
https://bugreports.qt.io/browse/QTBUG-58324

Figured I'd share the news with you as well @echostorm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.