Streamlined window controls code.
Fixed LP bug 1102076.
Merge pull request #46 from snwh/devel

Fixed Bug 1102076