FIX: [linux] fix & optimize input device checking