aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElaina Martineau <elainamartineau@gmail.com>2019-03-24 18:27:34 -0600
committerChristian Duerr <chrisduerr@users.noreply.github.com>2019-03-25 00:27:34 +0000
commit022f0782e4ce5512a7039ba8cd57f2a348740954 (patch)
treea2dbb68687286d4e05cb0a296bdcfd2adbe50e02
parent3e36d714fec8139a1e506036a394b343bd1a8bb4 (diff)
downloadalacritty-022f0782e4ce5512a7039ba8cd57f2a348740954.tar.gz
alacritty-022f0782e4ce5512a7039ba8cd57f2a348740954.zip
Fix `start_maximized` option on X11
-rw-r--r--CHANGELOG.md2
-rw-r--r--src/window.rs12
2 files changed, 12 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 47a6a17c..f1920191 100644
--- 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
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