Add support for resizing windows on wayland

    And remove unused code.