linux/x11: Fix closing of GPUI windows not working (#13201)
This fixes everything but the main Zed window (GPUI examples, prompt library, etc.) not being closable by clicking on the X in X11. We had a dangling reference before: we would remove the window from the X11 state, but GPUI itself would still have the window in its references. In order to fix this we have to call `window.close()`, which ends up calling `cx.remove_window()`, which removes the reference. That in turn then causes the reference to be dropped, which cleans up the X11 state for the window. Release Notes: - N/A
This commit is contained in:
parent
5dc54863a4
commit
64d815a176
1 changed files with 1 additions and 2 deletions
|
@ -475,9 +475,8 @@ impl X11Client {
|
||||||
if atom == state.atoms.WM_DELETE_WINDOW {
|
if atom == state.atoms.WM_DELETE_WINDOW {
|
||||||
// window "x" button clicked by user
|
// window "x" button clicked by user
|
||||||
if window.should_close() {
|
if window.should_close() {
|
||||||
let window_ref = state.windows.remove(&event.window)?;
|
|
||||||
state.loop_handle.remove(window_ref.refresh_event_token);
|
|
||||||
// Rest of the close logic is handled in drop_window()
|
// Rest of the close logic is handled in drop_window()
|
||||||
|
window.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue