Adding Event class. X11 window closes properly