topwin: code cleanup
window: fix bug that the window title not updated in some cases

In some cases, there is no PAINT event follow the ACTIVATE event, so
always update the title.

Thanks haitao for the bug report.