Skip to content
  • Peter Hutterer's avatar
    dix: disable all devices before shutdown · 4c68f5d3
    Peter Hutterer authored
    f3410b97
    
     introduced a regression on server
    shutdown. If any button or key was held on shutdown (ctrl, alt, backspace
    are usually still down) sending a raw event will segfault the server. The
    the root windows are set to NULL before calling CloseDownDevices().
    
    Avoid this by disabling all devices first when shutting down. Disabled
    devices won't send events anymore.
    
    Master keyboards must be disabled first, otherwise disabling the pointer
    will trigger DisableDevice(keyboard) and the keyboard is removed from the
    inputInfo.devices list and moved to inputInfo.off_devices. A regular loop
    through inputInfo.devices would thus jump to off_devices and not recover.
    
    Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
    Acked-by: default avatarChase Douglas <chase.douglas@canonical.com>
    Reviewed-by: default avatarChase Douglas <chase.douglas@canonical.com>
    4c68f5d3