Repository navigation
Wayland resize keeps up with the pointer - #2141
Draft
raphamorim wants to merge 3 commits into
Draft
raphamorim wants to merge 3 commits into
raphamorim wants to merge 3 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1921.
A Wayland resize drag sends a configure every few milliseconds. For each one Rio called
screen.resize, which rebuilt the Vulkan swapchain behind adevice_wait_idle, laid out every tab and pane, and sent each PTY a TIOCSWINSZ. Nothing paced frames to the compositor, so Rio fell behind and kept catching up after the pointer stopped.Changes
resizeonly records the size; the swapchain is rebuilt at the next acquire, at most once per frame, and not at all when the size didn't change.VK_EXT_swapchain_maintenance1(withVK_EXT_surface_maintenance1), every present carries aVkSwapchainPresentFenceInfoEXTfence. A retired swapchain and its views are destroyed once its frames' command buffers are done and every present to it has signalled its fence (VUID-vkDestroySwapchainKHR-swapchain-01282). Fences are recycled. Without the extension it idles the device before destroying, asmaindoes today.WindowExtWayland::frame_notifier(); sugarloaf calls a pre-present hook right before the Vulkan or wgpu present, so a callback is only requested when a commit follows.Resizedstores the size and it is applied at the nextRedrawRequested, so layout and TIOCSWINSZ happen at most once per frame, with no delay. A hidden window gets no frame callbacks, so a one-frame (vblank_interval) timer applies a size no frame picked up.How other projects do it
wl_surface.framerequested right before commit.vkQueueWaitIdle. The present-fence path follows the Khronosswapchain_recreationsample.Known caveats
render_finishedsemaphores are per frame slot, not per swapchain image (VUID-vkQueueSubmit-pSignalSemaphores-00067).Testing
cargo test -p rioterm(311 pass), rio-window tests, clippy.x86_64-unknown-linux-gnu. The Linux sugarloaf build can't run on macOS here (freetype/fontconfig), so the new Vulkan code was type-checked against ash 0.38 in a standalone crate; CI is the first full compile. Not yet tried on a real Wayland session; testing from the reporters (ideally withRIO_VULKAN_VALIDATION=1) would help.