Skip to content
  • Peter Hutterer's avatar
    Drain the fd after opening · ad8483b9
    Peter Hutterer authored
    
    
    Make sure we don't send any events that may have been enqueued before we
    initialized ourselves. Specifically, if we're using systemd-logind the fd
    remains open when we disable/enable the device, allowing events to queue up on
    the fd. These events are then replayed once the device is re-opened.
    
    This is not the case when VT-switching, in that case logind closes the fd for
    us.
    
    Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: default avatarKeith Packard <keithp@keithp.com>
    ad8483b9