sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 83d769805ccb3cef34e0e6167680aeb51ce034e9
parent 58eb0c408277af0013fb582803599ea811da3e88
Author: Simon Ser <contact@emersion.fr>
Date:   Mon, 20 Apr 2020 09:33:40 +0200

Restrict relative output transforms to runtime changes

Prevent them from being used in the config file.

This is a breaking config file change.

References: https://github.com/swaywm/sway/issues/5236

Diffstat:
Msway/commands/output/transform.c | 4++++
Msway/sway-output.5.scd | 3++-
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/sway/commands/output/transform.c b/sway/commands/output/transform.c @@ -59,6 +59,10 @@ struct cmd_results *output_cmd_transform(int argc, char **argv) { config->handler_context.leftovers.argv = argv + 1; if (argc > 1 && (strcmp(argv[1], "clockwise") == 0 || strcmp(argv[1], "anticlockwise") == 0)) { + if (config->reloading) { + return cmd_results_new(CMD_INVALID, + "Relative transforms cannot be used in the configuration file"); + } if (!sway_assert(output->name != NULL, "Output config name not set")) { return NULL; } diff --git a/sway/sway-output.5.scd b/sway/sway-output.5.scd @@ -102,7 +102,8 @@ must be separated by one space. For example: to apply a rotation and flip, or "normal" to apply no transform. The rotation is performed clockwise. If a single output is chosen and a rotation direction is specified (_clockwise_ or _anticlockwise_) then the - transform is added or subtracted from the current transform. + transform is added or subtracted from the current transform (this cannot be + used directly in the configuration file). *output* <name> disable|enable Enables or disables the specified output (all outputs are enabled by