public void addWindow(final Window<?> window) {

        if (window.desktop != null) {
            throw new IllegalStateException("Can't add window: Window already used elsewhere");
        } else if (window.isClosed()) {
            throw new IllegalStateException("Can't add window: Window already closed");
        } else if (!windows.contains(window)) {
            window.desktop = this;
            windows.add(window);

            Disconnected.getGraphicsManager().invoke(new Runnable() {

                @Override
                public void run() {

                    for (DesktopWidget pushReceiver : pushReceivers) {
                        pushReceiver.callAddWindow(window);
                    }
                }
            });
        }
    }