Convert C code to Rust
Eliminate use of allow(dead_code) in window.rs