Add setting for enabling server-side decorations (#39250)
Previously, this was controllable via the undocumented ZED_WINDOW_DECORATIONS environment variable (added in #13866). Using an environment variable for this is inconvenient because it requires users to set that environment variable somehow before starting Zed, such as in the .desktop file or persistently in their shell. Controlling this via a Zed setting is more convenient. This does not modify the design of the titlebar in any way. It only moves the existing option from an environment variable to a Zed setting. Fixes #14165 Client-side decorations (default): <img width="3840" height="2160" alt="image" src="https://github.com/user-attachments/assets/525feb92-2f60-47d3-b0ca-47c98770fa8c" /> Server-side decorations in KDE Plasma: <img width="3840" height="2160" alt="image" src="https://github.com/user-attachments/assets/7379c7c8-e5e3-47ba-a3ea-4191fec9434d" /> Release Notes: - Changed option for Wayland server-side decorations from an environment variable to settings.json field --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
@@ -109,6 +109,9 @@ pub struct WorkspaceSettingsContent {
|
||||
///
|
||||
/// Default: true
|
||||
pub zoomed_padding: Option<bool>,
|
||||
/// What draws window decorations/titlebar, the client application (Zed) or display server
|
||||
/// Default: client
|
||||
pub window_decorations: Option<WindowDecorations>,
|
||||
}
|
||||
|
||||
#[with_fallible_options]
|
||||
@@ -290,6 +293,28 @@ pub enum BottomDockLayout {
|
||||
RightAligned,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Copy,
|
||||
Clone,
|
||||
Default,
|
||||
Debug,
|
||||
Serialize,
|
||||
Deserialize,
|
||||
PartialEq,
|
||||
JsonSchema,
|
||||
MergeFrom,
|
||||
strum::VariantArray,
|
||||
strum::VariantNames,
|
||||
)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum WindowDecorations {
|
||||
/// Zed draws its own window decorations/titlebar (client-side decoration)
|
||||
#[default]
|
||||
Client,
|
||||
/// Show system's window titlebar (server-side decoration; not supported by GNOME Wayland)
|
||||
Server,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Copy,
|
||||
Clone,
|
||||
|
||||
@@ -843,6 +843,7 @@ impl VsCodeSettings {
|
||||
resize_all_panels_in_dock: None,
|
||||
restore_on_file_reopen: self.read_bool("workbench.editor.restoreViewState"),
|
||||
restore_on_startup: None,
|
||||
window_decorations: None,
|
||||
show_call_status_icon: None,
|
||||
use_system_path_prompts: self.read_bool("files.simpleDialog.enable"),
|
||||
use_system_prompts: None,
|
||||
|
||||
Reference in New Issue
Block a user