Skip to content

Commit

Permalink
feat: emit dispatcher when any window is created during update
Browse files Browse the repository at this point in the history
  • Loading branch information
Syndelis committed Oct 19, 2023
1 parent e845db8 commit 846842b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules/hyprland/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,15 @@ 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_) {
bool created = false;
for (auto &workspace : workspaces_) {
if (workspace->on_window_opened(window_payload)) {
created = true;
any_window_created = true;
break;
}
}
Expand All @@ -212,6 +214,10 @@ auto Workspaces::update() -> void {
}
}

if (any_window_created) {
dp.emit();
}

windows_to_create_.clear();
windows_to_create_ = not_created;

Expand Down

0 comments on commit 846842b

Please sign in to comment.