Fixed .gitignore.
Improved window system detection.