Merged most of the recent changes from the Wine edit control.