Skip to content

Commit

Permalink
Make Windows resize event match terminal::size (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
generic-user1 authored Oct 9, 2022
1 parent 263a0fb commit f845cea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/event/source/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ impl EventSource for WindowsEventSource {
mouse_event
}
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) => {
let event = if record.set_focus {
Expand Down

0 comments on commit f845cea

Please sign in to comment.