From 920d85d35fa09098a929c1ac8a21e4bbcfa09d0d Mon Sep 17 00:00:00 2001
From: Bill Doyle <vil@vil.lv>
Date: Wed, 26 Feb 2020 23:36:14 -0500
Subject: Only destroy swaybar surface via ipc when needed

---
 swaybar/ipc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/swaybar/ipc.c b/swaybar/ipc.c
index cca510c6..a3a9b495 100644
--- a/swaybar/ipc.c
+++ b/swaybar/ipc.c
@@ -528,8 +528,10 @@ static bool handle_barconfig_update(struct swaybar *bar, const char *payload,
 		ipc_get_workspaces(bar);
 	}
 
+	bool moving_layer = strcmp(oldcfg->mode, newcfg->mode) != 0;
+
 	free_config(oldcfg);
-	determine_bar_visibility(bar, true);
+	determine_bar_visibility(bar, moving_layer);
 	return true;
 }
 
-- 
cgit v1.2.3