diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-06-18 22:27:57 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-06-19 07:40:52 +0300 |
commit | 5069b53d6c561d0f949cb0aec1d70397a2fb8a90 (patch) | |
tree | 9738ba995d5a520560fc4262ff7b025d6bfaf71e /sway/commands/xwayland.c | |
parent | ddad41f423db14f89f765fc134d45d1ea8a60caf (diff) |
config/xwayland: retain xwayland status on reload
Since xwayland can only be enabled/disabled at launch, the xwayland
status should be retained on reload. Having `xwayland enabled|disabled`
in the config, should not cause `config->xwayland` to be invalid on
reload. This also returns `CMD_FAILURE` with a message that xwayland
can only be enabled/disabled on launch when trying to set the invalid
status on reload. This allows swaynag to notify the user that the
change will not take effect until sway is restarted.
Diffstat (limited to 'sway/commands/xwayland.c')
-rw-r--r-- | sway/commands/xwayland.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sway/commands/xwayland.c b/sway/commands/xwayland.c index b72f3239..62293276 100644 --- a/sway/commands/xwayland.c +++ b/sway/commands/xwayland.c @@ -11,7 +11,12 @@ struct cmd_results *cmd_xwayland(int argc, char **argv) { } #ifdef HAVE_XWAYLAND - config->xwayland = parse_boolean(argv[0], config->xwayland); + bool xwayland = parse_boolean(argv[0], true); + if (config->reloading && config->xwayland != xwayland) { + return cmd_results_new(CMD_FAILURE, + "xwayland can only be enabled/disabled at launch"); + } + config->xwayland = xwayland; #else sway_log(SWAY_INFO, "Ignoring `xwayland` command, " "sway hasn't been built with Xwayland support"); |