Fix out of bounds error

This error could be triggered on tiling window managers that don't respect window sizes.