Improved settings window behavior