Make Windows resize event match terminal::size (#714)

This commit is contained in:
Nathan 2022-10-09 14:08:17 -04:00 committed by GitHub
parent 263a0fb5cf
commit f845cea516
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,7 +64,11 @@ impl EventSource for WindowsEventSource {
mouse_event mouse_event
} }
InputRecord::WindowBufferSizeEvent(record) => { InputRecord::WindowBufferSizeEvent(record) => {
Some(Event::Resize(record.size.x as u16, record.size.y as u16)) // windows starts counting at 0, unix at 1, add one to replicate unix behaviour.
Some(Event::Resize(
record.size.x as u16 + 1,
record.size.y as u16 + 1,
))
} }
InputRecord::FocusEvent(record) => { InputRecord::FocusEvent(record) => {
let event = if record.set_focus { let event = if record.set_focus {