Commit 0192f52d authored by Matt Keeler's avatar Matt Keeler Committed by Peter van der meulen

Handle HiDpiFactorChanged event better to update cached DPR

parent 3eddada1
......@@ -299,7 +299,7 @@ impl<N: Notify> Processor<N> {
resize_tx: &mpsc::Sender<PhysicalSize>,
hide_cursor: &mut bool,
window_is_focused: &mut bool,
dpr: f64,
dpr: &mut f64,
) {
match event {
// Pass on device events
......@@ -332,7 +332,7 @@ impl<N: Notify> Processor<N> {
::std::process::exit(0);
},
Resized(lsize) => {
resize_tx.send(lsize.to_physical(dpr)).expect("send new size");
resize_tx.send(lsize.to_physical(*dpr)).expect("send new size");
processor.ctx.terminal.dirty = true;
},
KeyboardInput { input, .. } => {
......@@ -386,7 +386,10 @@ impl<N: Notify> Processor<N> {
let path: String = path.to_string_lossy().into();
processor.ctx.write_to_pty(path.into_bytes());
},
HiDpiFactorChanged(_) => processor.ctx.terminal.dirty = true,
HiDpiFactorChanged(new_dpr) => {
*dpr = new_dpr;
processor.ctx.terminal.dirty = true;
},
_ => (),
}
},
......@@ -454,8 +457,8 @@ impl<N: Notify> Processor<N> {
};
let mut window_is_focused = window.is_focused;
let dpr = window.hidpi_factor();
let mut dpr = window.hidpi_factor();
// Scope needed to that hide_cursor isn't borrowed after the scope
// ends.
{
......@@ -471,7 +474,7 @@ impl<N: Notify> Processor<N> {
resize_tx,
hide_cursor,
&mut window_is_focused,
dpr,
&mut dpr,
);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment