xlib: skip set window focus if no window or display object exists.
@@ -576,6 +576,8 @@ class XlibWindow(BaseWindow):
return x.value, y.value
def activate(self):
+ # Issue 218
+ if self._x_display and self._window:
xlib.XSetInputFocus(self._x_display, self._window, xlib.RevertToParent, xlib.CurrentTime)
def set_visible(self, visible=True):
