diff options
author | Cole Helbling <cole.e.helbling@gmail.com> | 2019-03-11 05:35:49 -0700 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-03-11 12:35:49 +0000 |
commit | e240da9ab3b819a8845ced1ab72d0a4239eac789 (patch) | |
tree | 9b31f117de9ed9e6455eff1d4604379d4ea461ac /src/display.rs | |
parent | 0ec4bd28dadcf476baf6180af7cf93bea9214f19 (diff) | |
download | alacritty-e240da9ab3b819a8845ced1ab72d0a4239eac789.tar.gz alacritty-e240da9ab3b819a8845ced1ab72d0a4239eac789.zip |
Add option for window position at startup
Diffstat (limited to 'src/display.rs')
-rw-r--r-- | src/display.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/display.rs b/src/display.rs index 4873e02a..8266e655 100644 --- a/src/display.rs +++ b/src/display.rs @@ -140,6 +140,14 @@ impl Display { // Create the window where Alacritty will be displayed let mut window = Window::new(&options, config.window())?; + // TODO: replace `set_position` with `with_position` once available + // Upstream issue: https://github.com/tomaka/winit/issues/806 + // Set window position early so it doesn't "teleport" + let position = options.position().or_else(|| config.position()); + if let Some(position) = position { + window.set_position(position.x, position.y); + } + let dpr = window.hidpi_factor(); info!("Device pixel ratio: {}", dpr); |