mirror of
https://github.com/hyprwm/hypridle.git
synced 2025-12-25 03:20:03 +01:00
clang-format
This commit is contained in:
parent
3bba01419c
commit
973fdbc347
4 changed files with 22 additions and 17 deletions
|
|
@ -98,7 +98,8 @@ Hyprlang::CParseResult CConfigManager::postParse() {
|
|||
}
|
||||
|
||||
for (auto& r : m_vRules) {
|
||||
Debug::log(LOG, "Registered timeout rule for {}s:\n on-timeout: {}\n on-resume: {}\n ignore_inhibit: {}", r.timeout, r.onTimeout, r.onResume, r.ignoreInhibit);
|
||||
Debug::log(LOG, "Registered timeout rule for {}s:\n on-timeout: {}\n on-resume: {}\n ignore_inhibit: {}", r.timeout, r.onTimeout, r.onResume,
|
||||
r.ignoreInhibit);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ class CConfigManager {
|
|||
void init();
|
||||
|
||||
struct STimeoutRule {
|
||||
uint64_t timeout = 0;
|
||||
std::string onTimeout = "";
|
||||
std::string onResume = "";
|
||||
uint64_t timeout = 0;
|
||||
std::string onTimeout = "";
|
||||
std::string onResume = "";
|
||||
bool ignoreInhibit = false;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -56,22 +56,24 @@ void CHypridle::run() {
|
|||
|
||||
static const auto IGNOREWAYLANDINHIBIT = g_pConfigManager->getValue<Hyprlang::INT>("general:ignore_wayland_inhibit");
|
||||
|
||||
const auto RULES = g_pConfigManager->getRules();
|
||||
const auto RULES = g_pConfigManager->getRules();
|
||||
m_sWaylandIdleState.listeners.resize(RULES.size());
|
||||
|
||||
Debug::log(LOG, "found {} rules", RULES.size());
|
||||
|
||||
for (size_t i = 0; i < RULES.size(); ++i) {
|
||||
auto& l = m_sWaylandIdleState.listeners[i];
|
||||
const auto& r = RULES[i];
|
||||
l.onRestore = r.onResume;
|
||||
l.onTimeout = r.onTimeout;
|
||||
auto& l = m_sWaylandIdleState.listeners[i];
|
||||
const auto& r = RULES[i];
|
||||
l.onRestore = r.onResume;
|
||||
l.onTimeout = r.onTimeout;
|
||||
l.ignoreInhibit = r.ignoreInhibit;
|
||||
|
||||
if (*IGNOREWAYLANDINHIBIT || r.ignoreInhibit)
|
||||
l.notification = makeShared<CCExtIdleNotificationV1>(m_sWaylandIdleState.notifier->sendGetInputIdleNotification(r.timeout * 1000 /* ms */, m_sWaylandState.seat->resource()));
|
||||
l.notification =
|
||||
makeShared<CCExtIdleNotificationV1>(m_sWaylandIdleState.notifier->sendGetInputIdleNotification(r.timeout * 1000 /* ms */, m_sWaylandState.seat->resource()));
|
||||
else
|
||||
l.notification = makeShared<CCExtIdleNotificationV1>(m_sWaylandIdleState.notifier->sendGetIdleNotification(r.timeout * 1000 /* ms */, m_sWaylandState.seat->resource()));
|
||||
l.notification =
|
||||
makeShared<CCExtIdleNotificationV1>(m_sWaylandIdleState.notifier->sendGetIdleNotification(r.timeout * 1000 /* ms */, m_sWaylandState.seat->resource()));
|
||||
|
||||
l.notification->setData(&m_sWaylandIdleState.listeners[i]);
|
||||
|
||||
|
|
@ -297,7 +299,7 @@ void CHypridle::onInhibit(bool lock) {
|
|||
if (m_iInhibitLocks == 0 && isIdled) {
|
||||
static const auto IGNOREWAYLANDINHIBIT = g_pConfigManager->getValue<Hyprlang::INT>("general:ignore_wayland_inhibit");
|
||||
|
||||
const auto RULES = g_pConfigManager->getRules();
|
||||
const auto RULES = g_pConfigManager->getRules();
|
||||
for (size_t i = 0; i < RULES.size(); ++i) {
|
||||
auto& l = m_sWaylandIdleState.listeners[i];
|
||||
const auto& r = RULES[i];
|
||||
|
|
@ -305,9 +307,11 @@ void CHypridle::onInhibit(bool lock) {
|
|||
l.notification->sendDestroy();
|
||||
|
||||
if (*IGNOREWAYLANDINHIBIT || r.ignoreInhibit)
|
||||
l.notification = makeShared<CCExtIdleNotificationV1>(m_sWaylandIdleState.notifier->sendGetInputIdleNotification(r.timeout * 1000 /* ms */, m_sWaylandState.seat->resource()));
|
||||
l.notification =
|
||||
makeShared<CCExtIdleNotificationV1>(m_sWaylandIdleState.notifier->sendGetInputIdleNotification(r.timeout * 1000 /* ms */, m_sWaylandState.seat->resource()));
|
||||
else
|
||||
l.notification = makeShared<CCExtIdleNotificationV1>(m_sWaylandIdleState.notifier->sendGetIdleNotification(r.timeout * 1000 /* ms */, m_sWaylandState.seat->resource()));
|
||||
l.notification =
|
||||
makeShared<CCExtIdleNotificationV1>(m_sWaylandIdleState.notifier->sendGetIdleNotification(r.timeout * 1000 /* ms */, m_sWaylandState.seat->resource()));
|
||||
|
||||
l.notification->setData(&m_sWaylandIdleState.listeners[i]);
|
||||
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ class CHypridle {
|
|||
CHypridle();
|
||||
|
||||
struct SIdleListener {
|
||||
SP<CCExtIdleNotificationV1> notification = nullptr;
|
||||
std::string onTimeout = "";
|
||||
std::string onRestore = "";
|
||||
SP<CCExtIdleNotificationV1> notification = nullptr;
|
||||
std::string onTimeout = "";
|
||||
std::string onRestore = "";
|
||||
bool ignoreInhibit = false;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue