commit
4b20f522f0
|
@ -6,7 +6,9 @@
|
|||
#include <algorithm>
|
||||
#include <charconv>
|
||||
#include <memory>
|
||||
#include <shared_mutex>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <utility>
|
||||
#include <variant>
|
||||
|
||||
|
@ -14,6 +16,8 @@
|
|||
|
||||
namespace waybar::modules::hyprland {
|
||||
|
||||
std::shared_mutex workspaceCreateSmtx;
|
||||
|
||||
int Workspaces::windowRewritePriorityFunction(std::string const &window_rule) {
|
||||
// Rules that match against title are prioritized
|
||||
// Rules that don't specify if they're matching against either title or class are deprioritized
|
||||
|
@ -161,6 +165,7 @@ auto Workspaces::update() -> void {
|
|||
}
|
||||
|
||||
// add workspaces that wait to be created
|
||||
std::shared_lock<std::shared_mutex> workspaceCreateShareLock(workspaceCreateSmtx);
|
||||
unsigned int currentCreateWorkspaceNum = 0;
|
||||
for (Json::Value const &workspaceToCreate : m_workspacesToCreate) {
|
||||
createWorkspace(workspaceToCreate);
|
||||
|
@ -300,6 +305,7 @@ void Workspaces::onWorkspaceCreated(std::string const &payload) {
|
|||
if (name == payload &&
|
||||
(allOutputs() || m_bar.output->name == workspaceJson["monitor"].asString()) &&
|
||||
(showSpecial() || !name.starts_with("special")) && !isDoubleSpecial(payload)) {
|
||||
std::unique_lock<std::shared_mutex> workspaceCreateUniqueLock(workspaceCreateSmtx);
|
||||
m_workspacesToCreate.push_back(workspaceJson);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue