feat: emit dispatcher when any window is created during update

This commit is contained in:
Brenno Lemos 2023-10-19 10:45:00 -03:00
parent e845db84ad
commit 846842be80
1 changed files with 6 additions and 0 deletions

View File

@ -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;