From 4d1758457b319ee35bf203864287c9fca1e86396 Mon Sep 17 00:00:00 2001
From: patrick96
Date: Thu, 1 Aug 2024 11:06:13 +0200
Subject: [PATCH] fix(ipc): Clear output until initial hook finishes
Before, it just showed '%output%'
Fixes #3131
---
CHANGELOG.md | 1 +
src/modules/ipc.cpp | 2 ++
2 files changed, 3 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b3aff186..7a85716c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- i3: Fix duplicated rendering for non-full-width bars ([`#3091`](https://github.com/polybar/polybar/pull/3091), [`#3060`](https://github.com/polybar/polybar/issues/3060))
- `internal/backlight`: Module could display the literal `%percentage%` token if the backlight reports a value of 0 at startup ([`#3081`](https://github.com/polybar/polybar/pull/3081)) by [@unclechu](https://github.com/unclechu)
- `internal/tray`: Fix crash during restarting, when tray icons were not removed proberly ([`#3111`](https://github.com/polybar/polybar/issues/3111), [`#3112`](https://github.com/polybar/polybar/pull/3112))
+- `custom/ipc`: Module would display the literal `%output%` token before the initial hook finished executing ([`#3131`](https://github.com/polybar/polybar/issues/3131), [`#3140`](https://github.com/polybar/polybar/pull/3140))
## [3.7.1] - 2023-11-27
### Build
diff --git a/src/modules/ipc.cpp b/src/modules/ipc.cpp
index 9e337020..144bb404 100644
--- a/src/modules/ipc.cpp
+++ b/src/modules/ipc.cpp
@@ -79,6 +79,8 @@ namespace modules {
this->module::start();
m_mainthread = thread([&] {
m_log.trace("%s: Thread id = %i", this->name(), concurrency_util::thread_id(this_thread::get_id()));
+ // Initial update to start with an empty output until the initial hook finishes
+ update_output();
update();
broadcast();
});