Don't restart swaybg if the command hasn't changed

When outputs have changed but none of that has resulted in a change in
how swaybg should be run don't restart it. This avoids flickering the
background to grey as a result of bug #3693, and is generally good to
not churn through process termination and startup for a no-op.
This commit is contained in:
Pedro Côrte-Real 2020-09-02 20:25:04 +01:00
parent 139c4c5f74
commit df9265b29a
3 changed files with 58 additions and 21 deletions

View file

@ -476,6 +476,7 @@ struct sway_config {
// swaybg
char *swaybg_command;
char **swaybg_full_command;
struct wl_client *swaybg_client;
struct wl_listener swaybg_client_destroy;
@ -586,6 +587,7 @@ void config_add_swaynag_warning(char *fmt, ...);
/**
* Free config struct
*/
void free_swaybg_full_command(char** cmd);
void free_config(struct sway_config *config);
void free_sway_variable(struct sway_variable *var);