aboutsummaryrefslogtreecommitdiff
path: root/sway/config.c
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2019-04-14 00:27:47 -0400
committerSimon Ser <contact@emersion.fr>2019-04-14 12:41:59 +0300
commit6961bf2e4ce2c116e41a8db158691f6c993707ce (patch)
treea381146599a5f19e565006cafeb23edc04247d2b /sway/config.c
parent8c69da11bbe70caa2f5db1665e9d60387604c5e4 (diff)
Spawn swaynag as a wayland client
This spawns swaynag as a wayland client similar to how swaybar and swaybg are already done
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/sway/config.c b/sway/config.c
index d5bfe105..4944ec02 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -175,15 +175,13 @@ static void set_color(float dest[static 4], uint32_t color) {
static void config_defaults(struct sway_config *config) {
if (!(config->swaynag_command = strdup("swaynag"))) goto cleanup;
- config->swaynag_config_errors = (struct swaynag_instance){
- .args = "--type error "
+ config->swaynag_config_errors = (struct swaynag_instance){0};
+ config->swaynag_config_errors.args = "--type error "
"--message 'There are errors in your config file' "
"--detailed-message "
- "--button 'Exit sway' 'swaymsg exit' "
- "--button 'Reload sway' 'swaymsg reload'",
- .pid = -1,
- .detailed = true,
- };
+ "--button-no-terminal 'Exit sway' 'swaymsg exit' "
+ "--button-no-terminal 'Reload sway' 'swaymsg reload'";
+ config->swaynag_config_errors.detailed = true;
if (!(config->symbols = create_list())) goto cleanup;
if (!(config->modes = create_list())) goto cleanup;
@@ -411,10 +409,9 @@ bool load_main_config(const char *file, bool is_active, bool validating) {
config->reloading = true;
config->active = true;
- swaynag_kill(&old_config->swaynag_config_errors);
- memcpy(&config->swaynag_config_errors,
- &old_config->swaynag_config_errors,
- sizeof(struct swaynag_instance));
+ if (old_config->swaynag_config_errors.client != NULL) {
+ wl_client_destroy(old_config->swaynag_config_errors.client);
+ }
input_manager_reset_all_inputs();
}
@@ -486,7 +483,7 @@ bool load_main_config(const char *file, bool is_active, bool validating) {
spawn_swaybg();
config->reloading = false;
- if (config->swaynag_config_errors.pid > 0) {
+ if (config->swaynag_config_errors.client != NULL) {
swaynag_show(&config->swaynag_config_errors);
}