http://bugs.winehq.org/show_bug.cgi?id=15162
--- Comment #21 from Arkadiusz Piekarz piekarzarkadiusz@gmail.com 2008-10-18 11:38:43 --- Try to compile Wine hacks tree - http://repo.or.cz/w/wine/hacks.git
It has some commits to prevent focus loss - http://repo.or.cz/w/wine/hacks.git?a=commit;h=6ad4febc802779d39881ae7cccabf1... (it seems you have to activate that commit somehow, but I can't help you with it).
I experienced lack of keyboard focus, but only when I disabled window manager control.
BTW alt-tabbing of TF2 is buggy even on Windows - it often results in black and pink checkerbox instead of reflections, invisible models of players and so on. So I don't know if we can blame Wine here.