Re-applying a patch by Beliar in rev 3982

For some reason this got overwritten when I merged gui_enhanements.
Changing it back to what it was prior to the merge.