alacritty

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 022f0782e4ce5512a7039ba8cd57f2a348740954
parent 3e36d714fec8139a1e506036a394b343bd1a8bb4
Author: Elaina Martineau <elainamartineau@gmail.com>
Date:   Sun, 24 Mar 2019 18:27:34 -0600

Fix `start_maximized` option on X11


Diffstat:
MCHANGELOG.md | 2+-
Msrc/window.rs | 12+++++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -47,7 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixes increase/decrease font-size keybindings on international keyboards - On Wayland, the `--title` flag will set the Window title now - Parsing issues with URLs starting in the first or ending in the last column -- URLs stopping at double-width characters +- Fix `start_maximized` option on X11 ## Version 0.2.9 diff --git 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