diff options
author | Elaina Martineau <elainamartineau@gmail.com> | 2019-03-24 18:27:34 -0600 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-03-25 00:27:34 +0000 |
commit | 022f0782e4ce5512a7039ba8cd57f2a348740954 (patch) | |
tree | a2dbb68687286d4e05cb0a296bdcfd2adbe50e02 /src | |
parent | 3e36d714fec8139a1e506036a394b343bd1a8bb4 (diff) | |
download | alacritty-022f0782e4ce5512a7039ba8cd57f2a348740954.tar.gz alacritty-022f0782e4ce5512a7039ba8cd57f2a348740954.zip |
Fix `start_maximized` option on X11
Diffstat (limited to 'src')
-rw-r--r-- | src/window.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/window.rs b/src/window.rs index 2aaa760b..96b62cd3 100644 --- a/src/window.rs +++ b/src/window.rs @@ -24,6 +24,8 @@ use glutin::{ MouseCursor, WindowBuilder, ContextTrait }; use glutin::dpi::{LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize}; +#[cfg(not(any(target_os = "macos", windows)))] +use glutin::os::unix::EventsLoopExt; use crate::cli::Options; use crate::config::{Decorations, WindowConfig}; @@ -139,6 +141,14 @@ impl Window { .or_else(|_| create_gl_window(window_builder, &event_loop, true))?; window.show(); + // Maximize window after mapping in X11 + #[cfg(not(any(target_os = "macos", windows)))] + { + if event_loop.is_x11() && window_config.start_maximized() { + window.set_maximized(true); + } + } + // Text cursor window.set_cursor(MouseCursor::Text); @@ -263,8 +273,8 @@ impl Window { .with_title(title) .with_visibility(false) .with_transparency(true) - .with_maximized(window_config.start_maximized()) .with_decorations(decorations) + .with_maximized(window_config.start_maximized()) // X11 .with_class(class.into(), DEFAULT_NAME.into()) // Wayland |