From a75e9493449d90b54a140b76f6a96b684784a059 Mon Sep 17 00:00:00 2001 From: Dustin Date: Thu, 17 Oct 2019 15:24:21 -0400 Subject: Fix window title not filled by default In the config, if `window` is undefined, the derived `Default` for the String `title` is used, which is an empty String. This was unintended, and causes issues in gnome-shell (e.g. in the alt-tab dialog) when the window title is an empty string. This commit adds a manually implemented default for the `WindowConfig`, it's the same as the derived `Default`, except for the `title`, which will now always be "Alacritty" as originally intended. --- alacritty_terminal/src/config/window.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'alacritty_terminal/src/config') diff --git a/alacritty_terminal/src/config/window.rs b/alacritty_terminal/src/config/window.rs index 49bd70bb..3c06f85e 100644 --- a/alacritty_terminal/src/config/window.rs +++ b/alacritty_terminal/src/config/window.rs @@ -9,7 +9,7 @@ use crate::index::{Column, Line}; pub const DEFAULT_NAME: &str = "Alacritty"; #[serde(default)] -#[derive(Deserialize, Debug, Clone, Default, PartialEq, Eq)] +#[derive(Deserialize, Debug, Clone, PartialEq, Eq)] pub struct WindowConfig { /// Initial dimensions #[serde(deserialize_with = "failure_default")] @@ -69,6 +69,24 @@ impl WindowConfig { } } +impl Default for WindowConfig { + fn default() -> WindowConfig { + WindowConfig { + dimensions: Default::default(), + position: Default::default(), + padding: Default::default(), + decorations: Default::default(), + dynamic_padding: Default::default(), + startup_mode: Default::default(), + class: Default::default(), + embed: Default::default(), + gtk_theme_variant: Default::default(), + start_maximized: Default::default(), + title: default_title(), + } + } +} + #[derive(Debug, Deserialize, Copy, Clone, PartialEq, Eq)] pub enum StartupMode { Windowed, -- cgit v1.2.3-54-g00ecf