Skip to content

Commit

Permalink
#2048 fix regression causing window_destroyed signal to not trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
koekeishiya committed Jan 14, 2024
1 parent d55a647 commit 60380a1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Fix regression causing window_destroyed signal to not trigger [#2048](https://github.com/koekeishiya/yabai/issues/2048)

## [6.0.6] - 2024-01-08
### Changed
Expand Down
4 changes: 2 additions & 2 deletions src/event_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static EVENT_HANDLER(APPLICATION_TERMINATED)

if (g_mouse_state.window == window) g_mouse_state.window = NULL;

if (window_manager_is_window_eligible(window)) {
if (window->is_eligible) {
event_signal_push(SIGNAL_WINDOW_DESTROYED, window);
}

Expand Down Expand Up @@ -472,7 +472,7 @@ static EVENT_HANDLER(WINDOW_DESTROYED)

if (g_mouse_state.window == window) g_mouse_state.window = NULL;

if (window_manager_is_window_eligible(window)) {
if (window->is_eligible) {
event_signal_push(SIGNAL_WINDOW_DESTROYED, window);
}

Expand Down
1 change: 1 addition & 0 deletions src/rule.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ void rule_add(struct rule *rule)
window_manager_apply_manage_rule_to_window(&g_space_manager, &g_window_manager, window, rule, window_title, window_role, window_subrole);

if (window_manager_is_window_eligible(window)) {
window->is_eligible = true;
window_manager_apply_rule_to_window(&g_space_manager, &g_window_manager, window, rule, window_title, window_role, window_subrole);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct window
uint32_t *volatile id_ptr;
CGRect frame;
bool is_root;
bool is_eligible;
uint8_t notification;
uint8_t rule_flags;
uint8_t flags;
Expand Down
1 change: 1 addition & 0 deletions src/window_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,7 @@ struct window *window_manager_create_and_add_window(struct space_manager *sm, st
window_manager_apply_manage_rules_to_window(sm, wm, window, window_title, window_role, window_subrole);

if (window_manager_is_window_eligible(window)) {
window->is_eligible = true;
window_manager_apply_rules_to_window(sm, wm, window, window_title, window_role, window_subrole);
window_manager_purify_window(wm, window);
window_manager_set_window_opacity(wm, window, wm->normal_window_opacity);
Expand Down

0 comments on commit 60380a1

Please sign in to comment.