widget: Add window geometry helper function

Encapsulate this into a helper function that'll be used in gnome-terminal,
instead of having to poke at the internas like character width and height.