aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2020-04-20 09:33:40 +0200
committerLibravatar Drew DeVault <sir@cmpwn.com>2020-04-21 14:52:17 +0200
commit83d769805ccb3cef34e0e6167680aeb51ce034e9 (patch)
tree7c42c6f35851fa938d1db68b8f0e78ae0109dc89
parentscdoc: unbindcode --input-device, not input-device (diff)
downloadsway-83d769805ccb3cef34e0e6167680aeb51ce034e9.tar.gz
sway-83d769805ccb3cef34e0e6167680aeb51ce034e9.tar.zst
sway-83d769805ccb3cef34e0e6167680aeb51ce034e9.zip
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
-rw-r--r--sway/commands/output/transform.c4
-rw-r--r--sway/sway-output.5.scd3
2 files changed, 6 insertions, 1 deletions
diff --git a/sway/commands/output/transform.c b/sway/commands/output/transform.c
index 5e6efb5b..f4fcc8c9 100644
--- 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) {
59 config->handler_context.leftovers.argv = argv + 1; 59 config->handler_context.leftovers.argv = argv + 1;
60 if (argc > 1 && 60 if (argc > 1 &&
61 (strcmp(argv[1], "clockwise") == 0 || strcmp(argv[1], "anticlockwise") == 0)) { 61 (strcmp(argv[1], "clockwise") == 0 || strcmp(argv[1], "anticlockwise") == 0)) {
62 if (config->reloading) {
63 return cmd_results_new(CMD_INVALID,
64 "Relative transforms cannot be used in the configuration file");
65 }
62 if (!sway_assert(output->name != NULL, "Output config name not set")) { 66 if (!sway_assert(output->name != NULL, "Output config name not set")) {
63 return NULL; 67 return NULL;
64 } 68 }
diff --git a/sway/sway-output.5.scd b/sway/sway-output.5.scd
index 1805e54d..0315c1d9 100644
--- a/sway/sway-output.5.scd
+++ b/sway/sway-output.5.scd
@@ -102,7 +102,8 @@ must be separated by one space. For example:
102 to apply a rotation and flip, or "normal" to apply no transform. The 102 to apply a rotation and flip, or "normal" to apply no transform. The
103 rotation is performed clockwise. If a single output is chosen and a 103 rotation is performed clockwise. If a single output is chosen and a
104 rotation direction is specified (_clockwise_ or _anticlockwise_) then the 104 rotation direction is specified (_clockwise_ or _anticlockwise_) then the
105 transform is added or subtracted from the current transform. 105 transform is added or subtracted from the current transform (this cannot be
106 used directly in the configuration file).
106 107
107*output* <name> disable|enable 108*output* <name> disable|enable
108 Enables or disables the specified output (all outputs are enabled by 109 Enables or disables the specified output (all outputs are enabled by