Improve no-X-window logic