Fixes crash when the width and/or height is changing. https://bugzilla.gnome.org/show_bug.cgi?id=762765