mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-13 14:42:29 +02:00
feat: emit dispatcher when any window is created during update
This commit is contained in:
@ -194,6 +194,7 @@ auto Workspaces::update() -> void {
|
||||
workspace->update(format_, workspace_icon);
|
||||
}
|
||||
|
||||
bool any_window_created = false;
|
||||
std::vector<CreateWindow> not_created;
|
||||
|
||||
for (auto &window_payload : windows_to_create_) {
|
||||
@ -201,6 +202,7 @@ auto Workspaces::update() -> void {
|
||||
for (auto &workspace : workspaces_) {
|
||||
if (workspace->on_window_opened(window_payload)) {
|
||||
created = true;
|
||||
any_window_created = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -212,6 +214,10 @@ auto Workspaces::update() -> void {
|
||||
}
|
||||
}
|
||||
|
||||
if (any_window_created) {
|
||||
dp.emit();
|
||||
}
|
||||
|
||||
windows_to_create_.clear();
|
||||
windows_to_create_ = not_created;
|
||||
|
||||
|
Reference in New Issue
Block a user