def setupWindowHandler():
    """'Link' the corresponding window handler class to WindowHandler."""
    # Don't initialize the window handler here.
    # We need MCEdit display objects to get the right object.
    global WindowHandler
    if USE_WM:
        log.warn("Initializing window management...")
        if sys.platform == 'linux2':
            if XWindowHandler.desk_env == 'unknown':
                log.warning("Your desktop environment could not be determined. The support for window sizing/moving is not availble.")
            elif XWindowHandler.desk_env in linux_unsuported:
                log.warning("Your desktop environment is not yet supported for window sizing/moving.")
            else:
                WindowHandler = XWindowHandler
                log.info("XWindowHandler initialized.")
        elif sys.platform == 'win32':
            WindowHandler = WWindowHandler
            log.info("WWindowHandler initialized.")
    return WindowHandler
'Link' the corresponding window handler class to WindowHandler.
mcplatform.py