From 1fc69424827480402a4df29b66c511214326200c Mon Sep 17 00:00:00 2001
From: patrick96
Date: Tue, 1 Oct 2019 17:06:06 +0200
Subject: [PATCH] fix(ipc): Update bar when making bar visible
While an update was forced whenever polybar was made visible, the
`m_lastinput` variable was still set to the same value as when the bar
became hidden because updates to it were prevented.
Fixes #1875
---
src/components/bar.cpp | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/components/bar.cpp b/src/components/bar.cpp
index 1ba76b5f..53dae9a9 100644
--- a/src/components/bar.cpp
+++ b/src/components/bar.cpp
@@ -319,19 +319,20 @@ void bar::parse(string&& data, bool force) {
std::lock_guard guard(m_mutex, std::adopt_lock);
+ bool unchanged = data == m_lastinput;
+
+ m_lastinput = data;
+
if (force) {
m_log.trace("bar: Force update");
} else if (!m_visible) {
return m_log.trace("bar: Ignoring update (invisible)");
} else if (m_opts.shaded) {
return m_log.trace("bar: Ignoring update (shaded)");
- } else if (data == m_lastinput) {
+ } else if (unchanged) {
return m_log.trace("bar: Ignoring update (unchanged)");
- return;
}
- m_lastinput = data;
-
auto rect = m_opts.inner_area();
if (m_tray && !m_tray->settings().detached && m_tray->settings().configured_slots) {