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
This commit is contained in:
patrick96 2019-10-01 17:06:06 +02:00 committed by Patrick Ziegler
parent b162e17583
commit 1fc6942482

View File

@ -319,19 +319,20 @@ void bar::parse(string&& data, bool force) {
std::lock_guard<std::mutex> guard(m_mutex, std::adopt_lock); std::lock_guard<std::mutex> guard(m_mutex, std::adopt_lock);
bool unchanged = data == m_lastinput;
m_lastinput = data;
if (force) { if (force) {
m_log.trace("bar: Force update"); m_log.trace("bar: Force update");
} else if (!m_visible) { } else if (!m_visible) {
return m_log.trace("bar: Ignoring update (invisible)"); return m_log.trace("bar: Ignoring update (invisible)");
} else if (m_opts.shaded) { } else if (m_opts.shaded) {
return m_log.trace("bar: Ignoring update (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_log.trace("bar: Ignoring update (unchanged)");
return;
} }
m_lastinput = data;
auto rect = m_opts.inner_area(); auto rect = m_opts.inner_area();
if (m_tray && !m_tray->settings().detached && m_tray->settings().configured_slots) { if (m_tray && !m_tray->settings().detached && m_tray->settings().configured_slots) {