If you have malware on your desktop PC, only those private keys which are stored on this pc will get compromised (considering they aren't secured in any other way, e.g. encryption).
Thats true, never challenged that fact.
1) Malware usually is not a key logger. Key logger are quite underrepresented actually.
2) A Keylogger would not steal a securely/randomly generated key. A keylogger does that what the name says.. it logs every keystrokes and broadcasts them to the "hacker".
So if you don't type that key (private key / seed) nothing will get transmitted.
for example you may install a wallet and after you generate the new wallet safely it simply replaces the wallet file with the one it creates.
the malware doesn't even have to be online to do that. it can have the master pubkey hardcoded in it. so your wallet keeps giving you the addresses that the hacker controls
This actually is not that easy.
These malware would have to interact with the program creating the seed/private key.
This would require to hijack the process generating those keys. Thats just way too much work for such a simple effect.
Its way easier to just realize a keylogger/clipboardvirus/exploit(which lets you steal those keys)/reading out memory when private key is being used/ etc...
But in the end my statement is still true.
Private keys which have been generated BEFORE the infection (and are no longer stored there) won't get compromised.
Simply because there is nothing to get compromised.
One more word.
Trezor.