KT: properly fill the Hidden state flag.
KT: use proper property for detecting minimized windows.