summaryrefslogtreecommitdiff
path: root/src/display.rs
diff options
context:
space:
mode:
authorCole Helbling <cole.e.helbling@gmail.com>2019-03-11 05:35:49 -0700
committerChristian Duerr <chrisduerr@users.noreply.github.com>2019-03-11 12:35:49 +0000
commite240da9ab3b819a8845ced1ab72d0a4239eac789 (patch)
tree9b31f117de9ed9e6455eff1d4604379d4ea461ac /src/display.rs
parent0ec4bd28dadcf476baf6180af7cf93bea9214f19 (diff)
downloadalacritty-e240da9ab3b819a8845ced1ab72d0a4239eac789.tar.gz
alacritty-e240da9ab3b819a8845ced1ab72d0a4239eac789.zip
Add option for window position at startup
Diffstat (limited to 'src/display.rs')
-rw-r--r--src/display.rs8
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);