Better events handling on X11