Mouse cursor disappears, shake mouse (trackpad swipes), Sierra logs me out
I've got a strange problem that has happened several times.
I'm using my MacBook Pro (Mid-2010) running Sierra 10.12.1 and the mouse cursor (the pointer) seems to have disappeared. So I swipe back and forth to get the giant cursor to see where it is. Most times this works fine. But sometimes (has happened at least four times to me) there's an immediate logout of my profile. I'm now at the login screen and have to type-in my password to get back in. All applications seem to launch much faster than a normal boot-up login so maybe they were still resident in memory, but I know they are restarting because the GPG plugin for Mail isn't compatible yet and I always get a pop-up telling me that when Mail app starts.
What could be causing my Mac to suddenly logout just because I'm shaking my mouse cursor?
MacBook Pro, macOS Sierra (10.12.1), 8GB RAM, 1TB SSD