Fixed non-client rectangle calculations in managed mode. Added support for icon window in managed mode.
thread that created the corresponding X window. Spawn a separate thread to run the desktop message loop in desktop mode.