mid-2011 Macbook Air changes applications on wake from sleep

When my new Macbook Air (13" mid-2011, Lion) wakes from sleep (by opening the lid, clicking the mouse or pressing the space bar), it usually wakes to the last application I was using, then changes applications as if I had pressed alt-tab.

  1. Has anyone else observed this phenomenon and
  2. Does anyone know what could be causing it

Solution 1:

This is related to the System Preference for when it prompts you for a password when it wakes up. Change it to never, and it goes away (less secure) or always (more secure, but a PITA). Here's the link that helped me:

https://discussions.apple.com/thread/3268136?start=0&tstart=0

Solution 2:

Repair your disk permission.

Reboot your system then press the ALT key. Select the Recovery partition and then use Disk Utility to repair permission.

I think permissions repair better when you're not using the volume that you're mounted on.