fix bugs on titlebar about focus