shibang
d06e3d26c3
gpui: Persist window bounds and display when detaching a workspace session (#45201)
Closes #41246 #45092
Release Notes:
- N/A
**Root Cause**:
Empty local workspaces returned `DetachFromSession` from
`serialize_workspace_location()`, and the `DetachFromSession` handler
only cleared the session_id **without saving window bounds**.
**Fix Applied**:
Modified the `DetachFromSession` handler to save window bounds via
`set_window_open_status()`:
```rust
WorkspaceLocation::DetachFromSession => {
let window_bounds = SerializedWindowBounds(window.window_bounds());
let display = window.display(cx).and_then(|d| d.uuid().ok());
window.spawn(cx, async move |_| {
persistence::DB
.set_window_open_status(database_id, window_bounds, display.unwrap_or_default())
.await.log_err();
persistence::DB.set_session_id(database_id, None).await.log_err();
})
}
```
**Recording**:
https://github.com/user-attachments/assets/2b6564d4-4e1b-40fe-943b-147296340aa7
2025-12-18 12:03:42 +01:00
..
2025-12-10 12:10:43 -08:00
2025-12-17 18:49:39 +00:00
2025-10-13 12:41:42 +02:00
2025-12-09 07:50:10 +00:00
2025-12-17 17:42:18 -05:00
2025-12-18 01:56:12 +00:00
2025-12-16 11:16:27 +00:00
2025-12-15 10:14:15 +00:00
2025-12-17 16:51:16 +00:00
2025-10-13 12:41:42 +02:00
2025-12-18 12:03:42 +01:00
2025-12-04 03:55:04 +05:30
2025-12-17 20:41:46 +02:00
2025-12-16 05:10:33 +00:00
2025-09-30 11:41:49 +00:00
2025-09-18 12:03:35 +02:00
2025-11-22 22:26:26 -03:00
2025-08-18 11:01:32 +00:00
2025-10-27 20:37:37 -06:00
2025-12-15 10:14:15 +00:00
2025-12-17 16:51:16 +00:00
2025-11-21 19:56:00 +00:00
2025-12-18 12:03:42 +01:00