fixes a deadlock in xcb where the X window may not exist. https://bugzilla.gnome.org/show_bug.cgi?id=745633