Skip to content

Commit

Permalink
[macOS, X11] Fix duplicate close requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
bruvzg committed May 28, 2024
1 parent be56cab commit 1a40cda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion platform/linuxbsd/x11/display_server_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4206,7 +4206,10 @@ void DisplayServerX11::popup_close(WindowID p_window) {
WindowID win_id = E->get();
popup_list.erase(E);

_send_window_event(windows[win_id], DisplayServerX11::WINDOW_EVENT_CLOSE_REQUEST);
if (win_id != p_window) {
// Only request close on related windows, not this window. We are already processing it.
_send_window_event(windows[win_id], DisplayServerX11::WINDOW_EVENT_CLOSE_REQUEST);
}
E = F;
}
}
Expand Down
5 changes: 4 additions & 1 deletion platform/macos/display_server_macos.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3448,7 +3448,10 @@
WindowID win_id = E->get();
popup_list.erase(E);

send_window_event(windows[win_id], DisplayServerMacOS::WINDOW_EVENT_CLOSE_REQUEST);
if (win_id != p_window) {
// Only request close on related windows, not this window. We are already processing it.
send_window_event(windows[win_id], DisplayServerMacOS::WINDOW_EVENT_CLOSE_REQUEST);
}
E = F;
}
if (!was_empty && popup_list.is_empty()) {
Expand Down

0 comments on commit 1a40cda

Please sign in to comment.