Fix some event handling and re-read client protocols before deleting a window.