Skip to content

Apply tearing hints on surface commit - #168

Open
marcoallegretti wants to merge 1 commit into
bea4dev:mainfrom
marcoallegretti:fix/tearing-control-commit-state
Open

marcoallegretti wants to merge 1 commit into
bea4dev:mainfrom
marcoallegretti:fix/tearing-control-commit-state

Conversation

@marcoallegretti

Copy link
Copy Markdown
Contributor

Fixes #153.

Presentation hints currently become visible as soon as set_presentation_hint is dispatched. Destroying the control also resets the hint immediately. Both changes are double-buffered by the Wayland protocol, so a repaint before the next surface commit can observe the wrong hint.

Store presentation hints in Smithay's cached surface state and read only the current value. Keep control-object existence immediate for duplicate-object detection. This also follows synchronized subsurface transactions without changing TTY tearing eligibility, configuration overrides, or hardware checks.

API impact: no public Rust or TypeScript API changes. Hint changes become observable at the protocol-defined commit boundary.

Validation:

  • Before the fix, three socket-pair Wayland regression tests failed for an uncommitted async hint, an early destroy reset, and an early synchronized-subsurface update.
  • cargo test -p shojiwm_lib --lib --locked protocols::tearing_control::tests: 4 passed, none ignored. Covers async/vsync commit boundaries, last pending hint, persistence across commits, destroy/reset, recreation before commit, and synchronized subsurfaces.
  • cargo test -p shojiwm_lib --lib --locked: 317 passed, 1 failed, 4 ignored. The failure is xwayland_satellite::tests::skips_a_display_with_an_occupied_abstract_socket, which cannot prepare its socket directory because /tmp/.X11-unix is not writable. That code is unchanged.
  • Formatting checks for both changed Rust files and git diff --check pass.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Buffer tearing-control hints until wl_surface.commit

1 participant