Deprecate throttle-output and throttle-output-for

The eventloop no longer uses them. libuv will coalesces multiple
uv_async_send if they happen one after another and this also leads to
coalescing of updates.
This commit is contained in:
patrick96 2021-09-12 22:48:27 +02:00 committed by Patrick Ziegler
parent 511e73b3b5
commit dd4088910e
5 changed files with 22 additions and 10 deletions

View File

@ -51,6 +51,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
repository. repository.
- The `POLYBAR_FLAGS` cmake variable can be used to pass extra C++ compiler flags. - The `POLYBAR_FLAGS` cmake variable can be used to pass extra C++ compiler flags.
### Deprecated
- `[settings]`: `throttle-output` and `throttle-output-for` have been removed.
The new event loop already does a similar thing where it coalesces update
triggers if they happen directly after one another, leading to only a single
bar update.
### Added ### Added
- `internal/memory`: New tokens `%used%`, `%free%`, `%total%`, `%swap_total%`, - `internal/memory`: New tokens `%used%`, `%free%`, `%total%`, `%swap_total%`,
`%swap_free%`, and `%swap_used%` that automatically switch between MiB and GiB `%swap_free%`, and `%swap_used%` that automatically switch between MiB and GiB

View File

@ -182,6 +182,8 @@ class config {
return default_value; return default_value;
} }
void ignore_key(const string& section, const string& key) const;
/** /**
* Attempt to load value using the deprecated key name. If successful show a * Attempt to load value using the deprecated key name. If successful show a
* warning message. If it fails load the value using the new key and given * warning message. If it fails load the value using the new key and given

View File

@ -56,6 +56,12 @@ void config::set_included(file_list included) {
m_included = move(included); m_included = move(included);
} }
void config::ignore_key(const string& section, const string& key) const {
if (has(section, key)) {
m_log.warn("The config parameter '%s.%s' is deprecated, it will be removed in the future. Please remove it from your config", section, key);
}
}
/** /**
* Print a deprecation warning if the given parameter is set * Print a deprecation warning if the given parameter is set
*/ */

View File

@ -47,15 +47,11 @@ controller::controller(connection& conn, signal_emitter& emitter, const logger&
, m_conf(config) , m_conf(config)
, m_bar(forward<decltype(bar)>(bar)) , m_bar(forward<decltype(bar)>(bar))
, m_ipc(forward<decltype(ipc)>(ipc)) { , m_ipc(forward<decltype(ipc)>(ipc)) {
if (m_conf.has("settings", "throttle-input-for")) { m_conf.ignore_key("settings", "throttle-input-for");
m_log.warn( m_conf.ignore_key("settings", "throttle-output");
"The config parameter 'settings.throttle-input-for' is deprecated, it will be removed in the future. Please " m_conf.ignore_key("settings", "throttle-output-for");
"remove it from your config"); m_conf.ignore_key("settings", "eventqueue-swallow");
} m_conf.ignore_key("settings", "eventqueue-swallow-time");
// TODO deprecate both
m_conf.deprecated("settings", "eventqueue-swallow", "throttle-output", 0);
m_conf.deprecated("settings", "eventqueue-swallow-time", "throttle-output-for", 0);
m_log.trace("controller: Setup user-defined modules"); m_log.trace("controller: Setup user-defined modules");
size_t created_modules{0}; size_t created_modules{0};

View File

@ -1,5 +1,7 @@
#include "components/eventloop.hpp" #include "components/eventloop.hpp"
#include <cassert>
POLYBAR_NS POLYBAR_NS
/** /**