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.
This commit is contained in:
Brian Ashworth 2019-06-18 22:27:57 -04:00 committed by Simon Ser
parent ddad41f423
commit 5069b53d6c
2 changed files with 11 additions and 1 deletions

View file

@ -441,6 +441,11 @@ bool load_main_config(const char *file, bool is_active, bool validating) {
config->reloading = true;
config->active = true;
// xwayland can only be enabled/disabled at launch
sway_log(SWAY_DEBUG, "xwayland will remain %s",
old_config->xwayland ? "enabled" : "disabled");
config->xwayland = old_config->xwayland;
if (old_config->swaybg_client != NULL) {
wl_client_destroy(old_config->swaybg_client);
}