From aef26084ef5eb19acaefc2a73cbbe4dcfa66fdd9 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 23 Feb 2019 23:50:24 -0800 Subject: [PATCH] force re-assessment of sizes when changing font scaling --- src/gliumwindows.rs | 2 +- src/guicommon/window.rs | 6 +++--- src/xwindows/xwin.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gliumwindows.rs b/src/gliumwindows.rs index a258dbd2c..97968ad73 100644 --- a/src/gliumwindows.rs +++ b/src/gliumwindows.rs @@ -395,7 +395,7 @@ impl GliumTerminalWindow { let (width, height): (u32, u32) = size.to_physical(dpi_scale).into(); let width = width as u16; let height = height as u16; - self.resize_surfaces(width, height) + self.resize_surfaces(width, height, false) } fn decode_modifiers(state: glium::glutin::ModifiersState) -> term::KeyModifiers { diff --git a/src/guicommon/window.rs b/src/guicommon/window.rs index 2d2e046f1..70bd4e356 100644 --- a/src/guicommon/window.rs +++ b/src/guicommon/window.rs @@ -154,10 +154,10 @@ pub trait TerminalWindow { Ok(tab_id) } - fn resize_surfaces(&mut self, width: u16, height: u16) -> Result { + fn resize_surfaces(&mut self, width: u16, height: u16, force: bool) -> Result { let dims = self.get_dimensions(); - if width != dims.width || height != dims.height { + if force || width != dims.width || height != dims.height { debug!("resize {},{}", width, height); self.advise_renderer_of_resize(width, height)?; @@ -213,7 +213,7 @@ pub trait TerminalWindow { cell_height.ceil() as usize, )?; - self.resize_surfaces(width, height)?; + self.resize_surfaces(width, height, true)?; Ok(()) } diff --git a/src/xwindows/xwin.rs b/src/xwindows/xwin.rs index 7800d1680..2899a9fc3 100644 --- a/src/xwindows/xwin.rs +++ b/src/xwindows/xwin.rs @@ -352,7 +352,7 @@ impl X11TerminalWindow { } xcb::CONFIGURE_NOTIFY => { let cfg: &xcb::ConfigureNotifyEvent = unsafe { xcb::cast_event(event) }; - self.resize_surfaces(cfg.width(), cfg.height())?; + self.resize_surfaces(cfg.width(), cfg.height(), false)?; } xcb::KEY_PRESS => { let key_press: &xcb::KeyPressEvent = unsafe { xcb::cast_event(event) };