When I try to run SDL programs, I get the following error about 80% of the time:
Xlib: connection to ":0.0" refused by server
Xlib: XDM authorization key matches an existing client!
Could not initialize SDL: Couldn't open X11 display!
The other 20% of the time, the program starts just fine. As far as I can tell it's completely random.
Any ideas on how to fix this?

