fix(tray): Force bar update on change

Refs 
This commit is contained in:
Michael Carlberg 2017-01-09 14:27:55 +01:00
parent 5458c433b6
commit 6925415501
7 changed files with 35 additions and 27 deletions
src/components

View file

@ -311,18 +311,18 @@ const bar_settings bar::settings() const {
* @param data Input string
* @param force Unless true, do not parse unchanged data
*/
void bar::parse(string&& data) {
void bar::parse(string&& data, bool force) {
if (!m_mutex.try_lock()) {
return;
}
std::lock_guard<std::mutex> guard(m_mutex, std::adopt_lock);
if (m_opts.shaded) {
if (force) {
m_log.trace("bar: Force update");
} else if (m_opts.shaded) {
return m_log.trace("bar: Ignoring update (shaded)");
}
if (data == m_lastinput) {
} else if (data == m_lastinput) {
return;
}