diff --git a/src/modules/hyprland/windowcount.cpp b/src/modules/hyprland/windowcount.cpp index 5d9ee1c3..487b0083 100644 --- a/src/modules/hyprland/windowcount.cpp +++ b/src/modules/hyprland/windowcount.cpp @@ -37,6 +37,8 @@ WindowCount::~WindowCount() { } auto WindowCount::update() -> void { + std::lock_guard lg(mutex_); + queryActiveWorkspace(); std::string format = config_["format"].asString(); @@ -44,8 +46,6 @@ auto WindowCount::update() -> void { std::string formatWindowed = config_["format-windowed"].asString(); std::string formatFullscreen = config_["format-fullscreen"].asString(); - std::lock_guard lg(mutex_); - setClass("empty", workspace_.windows == 0); setClass("fullscreen", workspace_.hasfullscreen); @@ -118,8 +118,6 @@ auto WindowCount::Workspace::parse(const Json::Value& value) -> WindowCount::Wor } void WindowCount::queryActiveWorkspace() { - std::lock_guard lg(mutex_); - if (separateOutputs_) { workspace_ = getActiveWorkspace(this->bar_.output->name); } else {