Window resize handling. Fixes #43.