mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
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
@ -475,9 +475,8 @@ impl X11Client {
|
||||
if atom == state.atoms.WM_DELETE_WINDOW {
|
||||
// window "x" button clicked by user
|
||||
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()
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user