Skip to content

Commit

Permalink
Merge pull request #153 from heuer/issue_134
Browse files Browse the repository at this point in the history
Added Output.enable_adaptive_sync, fixes #134
  • Loading branch information
flacjacket authored Mar 18, 2024
2 parents 311673b + b81839b commit ca6eb1d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions wlroots/ffi_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,7 @@ def has_xwayland() -> bool:
int32_t height, int32_t refresh);
void wlr_output_set_transform(struct wlr_output *output,
enum wl_output_transform transform);
void wlr_output_enable_adaptive_sync(struct wlr_output *output, bool enabled);
void wlr_output_set_scale(struct wlr_output *output, float scale);
bool wlr_output_attach_render(struct wlr_output *output, int *buffer_age);
Expand Down
15 changes: 15 additions & 0 deletions wlroots/wlr_types/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,21 @@ def test(self) -> bool:
"""
return lib.wlr_output_test(self._ptr)

def enable_adaptive_sync(self, *, enable: bool = True) -> None:
"""
Enables or disables adaptive sync (ie. variable refresh rate) on this
output. On some backends, this is just a hint and may be ignored.
Compositors can inspect `wlr_output.adaptive_sync_status` to query the
effective status. Backends that don't support adaptive sync will reject
the output commit.
When enabled, compositors can submit frames a little bit later than the
deadline without dropping a frame.
Adaptive sync is double-buffered state, see commit().
"""
lib.wlr_output_enable_adaptive_sync(self._ptr, enable)

@property
def is_headless(self) -> bool:
return lib.wlr_output_is_headless(self._ptr)
Expand Down

0 comments on commit ca6eb1d

Please sign in to comment.