summaryrefslogtreecommitdiff
path: root/alacritty_terminal/src
diff options
context:
space:
mode:
authorDustin <dustin1114@gmail.com>2019-10-17 15:24:21 -0400
committerChristian Duerr <contact@christianduerr.com>2019-10-17 21:24:21 +0200
commita75e9493449d90b54a140b76f6a96b684784a059 (patch)
treec96f337ee460a7f45fddf2378b1afef977d320ea /alacritty_terminal/src
parentf1f51d3c0234831131dcaf8e5d63cc906453e51e (diff)
downloadalacritty-a75e9493449d90b54a140b76f6a96b684784a059.tar.gz
alacritty-a75e9493449d90b54a140b76f6a96b684784a059.zip
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.
Diffstat (limited to 'alacritty_terminal/src')
-rw-r--r--alacritty_terminal/src/config/window.rs20
1 files changed, 19 insertions, 1 deletions
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,