Skip to content

Commit fa60200

Browse files
authored
Configurable window decorations (#13866)
Introduces the `ZED_WINDOW_DECORATIONS` env variable. - Not set, defaulting to client-side decorations - Value is "client": client-side decorations - Value is "server": server-side decorations I think it's good to have this escape-hatch next to all possible detection mechanisms. Release Notes: - N/A
1 parent 9b7bc04 commit fa60200

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

crates/workspace/src/workspace.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6491,8 +6491,6 @@ pub fn client_side_decorations(element: impl IntoElement, cx: &mut WindowContext
64916491
cx.set_client_inset(theme::CLIENT_SIDE_DECORATION_SHADOW);
64926492
}
64936493

6494-
println!("decorations: {:?}", decorations);
6495-
64966494
struct GlobalResizeEdge(ResizeEdge);
64976495
impl Global for GlobalResizeEdge {}
64986496

crates/zed/src/zed.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ pub fn build_window_options(display_uuid: Option<Uuid>, cx: &mut AppContext) ->
9090
.find(|display| display.uuid().ok() == Some(uuid))
9191
});
9292
let app_id = ReleaseChannel::global(cx).app_id();
93+
let window_decorations = match std::env::var("ZED_WINDOW_DECORATIONS") {
94+
Ok(val) if val == "server" => gpui::WindowDecorations::Server,
95+
Ok(val) if val == "client" => gpui::WindowDecorations::Client,
96+
_ => gpui::WindowDecorations::Client,
97+
};
9398

9499
WindowOptions {
95100
titlebar: Some(TitlebarOptions {
@@ -105,7 +110,7 @@ pub fn build_window_options(display_uuid: Option<Uuid>, cx: &mut AppContext) ->
105110
display_id: display.map(|display| display.id()),
106111
window_background: cx.theme().window_background_appearance(),
107112
app_id: Some(app_id.to_owned()),
108-
window_decorations: Some(gpui::WindowDecorations::Client),
113+
window_decorations: Some(window_decorations),
109114
window_min_size: Some(gpui::Size {
110115
width: px(360.0),
111116
height: px(240.0),

0 commit comments

Comments
 (0)