summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-10-21 21:16:12 +0000
committerGitHub <noreply@github.com>2020-10-22 00:16:12 +0300
commit80688e082d13197b6661cfb6cfa60734034270cf (patch)
tree1852831ed650502a12ff44cd30d1a068a306f0c6
parent21eb84fc5e0e649f53e3785957fa127ee9a78688 (diff)
Check viewport size after initial resize
Since the 'set_inner_size' call might immediately alter the window size, the query for the window's dimensions should be performed after the resize has been requested.
-rw-r--r--alacritty/src/display.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/alacritty/src/display.rs b/alacritty/src/display.rs
index 0c5948fe..8a6cd220 100644
--- a/alacritty/src/display.rs
+++ b/alacritty/src/display.rs
@@ -206,9 +206,6 @@ impl Display {
info!("Device pixel ratio: {}", window.dpr);
- // get window properties for initializing the other subsystems.
- let viewport_size = window.inner_size();
-
// Create renderer.
let mut renderer = QuadRenderer::new()?;
@@ -226,6 +223,7 @@ impl Display {
}
let padding = config.ui_config.window.padding(window.dpr);
+ let viewport_size = window.inner_size();
// Create new size with at least one column and row.
let size_info = SizeInfo::new(
@@ -240,6 +238,7 @@ impl Display {
info!("Cell size: {} x {}", cell_width, cell_height);
info!("Padding: {} x {}", size_info.padding_x(), size_info.padding_y());
+ info!("Width: {}, Height: {}", size_info.width(), size_info.height());
// Update OpenGL projection.
renderer.resize(&size_info);