From f409f743724207e7a2a4c008ce74ea505ae6bbcf Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Sun, 5 Feb 2023 11:41:23 +0300 Subject: Resize the window by cell dimensions This should resize window by cell dimensions granularity instead of using pixels. Fixes #388. --- alacritty/src/display/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'alacritty/src/display/mod.rs') diff --git a/alacritty/src/display/mod.rs b/alacritty/src/display/mod.rs index 605ac3f2..243167b2 100644 --- a/alacritty/src/display/mod.rs +++ b/alacritty/src/display/mod.rs @@ -469,6 +469,9 @@ impl Display { renderer.finish(); } + // Set resize increments for the newly created window. + window.set_resize_increments(PhysicalSize::new(cell_width, cell_height)); + window.set_visible(true); #[allow(clippy::single_match)] @@ -642,6 +645,9 @@ impl Display { let search_lines = usize::from(search_active); new_size.reserve_lines(message_bar_lines + search_lines); + // Update resize increments. + self.window.set_resize_increments(PhysicalSize::new(cell_width, cell_height)); + // Resize PTY. pty_resize_handle.on_resize(new_size.into()); -- cgit