Implement Decorate/Undecorate with smart mode selection #1730
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.
Yet another approach for #1728.
This one is basically the
<action name="SetServerSideDecorationMode" mode="none|border|all"/>
approach. But on top of the three explicit values there are also "yes", "no", and "initial" which are meant to do the right thing™ automatically:keepBorder
and whether the window uses client side decorationsI did not yet change anything about
ToggleDecorations
. But with this approach there is a straight forward option:<action name="ToggleDecorations" mode1="value" mode2="value"/>
toggles between mode1 and mode2 (i.e.new_mode = current_mode == mode1 ? mode2 : mode1
). If they are not both provided, the old 3-state behavior is used instead.While very similar, I prefer this approach over #1725 because it provides both a high-level and a low-level API for users. The defaults make sense, but users still have full control over the exact behavior.