aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/window.rs
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2020-04-09 04:02:10 +0300
committerGitHub <noreply@github.com>2020-04-09 04:02:10 +0300
commit2fc5120327c6eb096154214faec5dc4e1dee2253 (patch)
treec7e6a03051949624bcb04501af2a1d7e6246288a /alacritty/src/window.rs
parent13eb50de799c4c6f7ebed1a7fa1ab25b378580bb (diff)
downloadr-alacritty-2fc5120327c6eb096154214faec5dc4e1dee2253.tar.gz
r-alacritty-2fc5120327c6eb096154214faec5dc4e1dee2253.tar.bz2
r-alacritty-2fc5120327c6eb096154214faec5dc4e1dee2253.zip
Use config colors to theme Wayland decorations
Fixes #2092.
Diffstat (limited to 'alacritty/src/window.rs')
-rw-r--r--alacritty/src/window.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/alacritty/src/window.rs b/alacritty/src/window.rs
index 71327bac..feb09c61 100644
--- a/alacritty/src/window.rs
+++ b/alacritty/src/window.rs
@@ -33,6 +33,8 @@ use image::ImageFormat;
#[cfg(not(any(target_os = "macos", windows)))]
use x11_dl::xlib::{Display as XDisplay, PropModeReplace, XErrorEvent, Xlib};
+#[cfg(not(any(target_os = "macos", windows)))]
+use alacritty_terminal::config::Colors;
use alacritty_terminal::config::{Decorations, StartupMode, WindowConfig};
use alacritty_terminal::event::Event;
#[cfg(not(windows))]
@@ -40,6 +42,8 @@ use alacritty_terminal::term::{SizeInfo, Term};
use crate::config::Config;
use crate::gl;
+#[cfg(not(any(target_os = "macos", windows)))]
+use crate::wayland_theme::AlacrittyWaylandTheme;
// It's required to be in this directory due to the `windows.rc` file
#[cfg(not(target_os = "macos"))]
@@ -158,6 +162,9 @@ impl Window {
if let Some(parent_window_id) = config.window.embed {
x_embed_window(windowed_context.window(), parent_window_id);
}
+ } else {
+ let theme = AlacrittyWaylandTheme::new(&config.colors);
+ windowed_context.window().set_wayland_theme(theme);
}
}
@@ -361,6 +368,11 @@ impl Window {
self.window().wayland_display()
}
+ #[cfg(not(any(target_os = "macos", target_os = "windows")))]
+ pub fn set_wayland_theme(&mut self, colors: &Colors) {
+ self.window().set_wayland_theme(AlacrittyWaylandTheme::new(colors));
+ }
+
/// Adjust the IME editor position according to the new location of the cursor
#[cfg(not(windows))]
pub fn update_ime_position<T>(&mut self, terminal: &Term<T>, size_info: &SizeInfo) {