Conversation
ShellScreen surfaces the geometry and density characteristics of a screen but not its refresh rate, so QML has no way to learn how often a screen refreshes. Shells that pace animations or reason about frame timing currently have to obtain it from the compositor over an out of band channel, if at all. QScreen already provides the value and a change signal, and it is populated on Wayland. Forward both, following the existing properties. The documentation notes that this reports the current mode's rate rather than measured presentation, since the two diverge under variable refresh.
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.
ShellScreenexposes a screen's geometry and density characteristics but notits refresh rate, so QML has no way to find out how often a screen refreshes.
Shells that pace animations, budget work per frame, or reason about frame
timing currently have to get it from the compositor over an out-of-band
channel, if they can get it at all.
QScreenalready tracks the value and emits a change signal for it, and it ispopulated on Wayland. This forwards both, in the same shape as the surrounding
properties: a
nullptrguard returning0.0for the dangling-screen case, anda signal-to-signal connection alongside the existing ones in the constructor.
The doc comment notes that this is the rate reported for the current mode
rather than a measurement of when frames are actually presented, since the two
diverge under variable refresh and the distinction matters for the timing use
case that motivates the property.
Testing
just fmtproduces no changes;clang-format -Werror --dry-runpasses on both files.just lint-changedequivalent (clang-tidy with tidyfox) reports no warnings ineither file. Verified the lint was actually running on them by temporarily
dropping a
this->in the new getter and confirmingtidyfox-explicit-thisptrcaught it.
just testpasses 9/9.ShellScreen.refreshRatereads59.999for aDP-1 output whose mode niri reports as 59.999 Hz. It read
undefinedbefore.QScreen::refreshRateandrefreshRateChangedare unguarded and long predateQt 6, so this needs no version gating against the 6.6.0 minimum.
Contributions
testing / validation, and write the commit message + PR draft description
contributers guidelines and added this section to provide some clarity on who did what, and
handled the actual PR submission.