Disconnect swaybg instead of killing it

This is much more reliable. This also fixes race conditions when killing swaybg
while it's doing a wl_display_roundtrip.
This commit is contained in:
emersion 2019-02-16 23:30:19 +01:00 committed by Brian Ashworth
parent 806129d3cc
commit 7baaa3a0f8
4 changed files with 80 additions and 26 deletions

View file

@ -233,9 +233,8 @@ void output_disable(struct sway_output *output) {
root_for_each_container(untrack_output, output);
if (output->bg_pid) {
terminate_swaybg(output->bg_pid);
output->bg_pid = 0;
if (output->swaybg_client != NULL) {
wl_client_destroy(output->swaybg_client);
}
int index = list_find(root->outputs, output);