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,8 +51,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
repository.
- 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
- `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
when below or above 1GiB.
([`2472`](https://github.com/polybar/polybar/issues/2472))

View File

@ -182,6 +182,8 @@ class config {
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
* 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);
}
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
*/

View File

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

View File

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