catacombing / kumo

A Wayland Mobile Browser
GNU General Public License v3.0
8 stars 1 forks source link

Adding new tabs is slow #20

Closed chrisduerr closed 1 month ago

chrisduerr commented 1 month ago

When adding a new tab, the UI feels a bit sluggish. The window is shrunk immediately due to the virtual keyboard popping up, however the URI bar takes a while to pop up again since the window isn't immediately resized.

When just focusing/unfocusing the URI bar repeatedly the window also gets resized, but it's much more responsive, which makes me believe there should be some significant improvement possible here. Most likely culprits are either WebKit slowing the process/phone down, or some sort of synchronization/dirtiness issue.

chrisduerr commented 1 month ago

I believe the issue here might be that while the UI is being resized properly, the engine takes a while to resize. Since that surface is layered above the UI surface, the already resized UI does not become visible until the engine is resized. The engine's size also isn't clamped, causing the window to stay the previous size until a new engine frame arrives.

To avoid the engine buffer extending over the UI boundaries, the engine's surface should definitely be clamped to the window's expected bounds.

chrisduerr commented 1 month ago

While https://github.com/catacombing/kumo/commit/be858fd5311abff6819c1243003e350532a28a27 fixes this issue when the active tab is resized, it does not fix the issue when opening a new tab.

There's likely more to this issue that causes the tab opening process to take additional time compared to a normal resize or redraw.