void QHaikuWindow::setWindowState(Qt::WindowState state)
{
    setFrameMarginsEnabled(state != Qt::WindowFullScreen);
    m_positionIncludesFrame = false;

    switch (state) {
    case Qt::WindowFullScreen:
        setGeometryImpl(screen()->geometry());
        break;
    case Qt::WindowMaximized:
    	m_normalGeometry = geometry();
		setGeometryImpl(screen()->availableGeometry().adjusted(m_margins.left(),
			m_margins.top(), -m_margins.right(), -m_margins.bottom()));
		break;
    case Qt::WindowMinimized:
        break;
    case Qt::WindowNoState:
        setGeometryImpl(m_normalGeometry);
        break;
    default:
        break;
    }

    QWindowSystemInterface::handleWindowStateChanged(window(), state);
}
void QOffscreenWindow::setGeometry(const QRect &rect)
{
    if (window()->windowState() != Qt::WindowNoState)
        return;

    m_positionIncludesFrame = qt_window_private(window())->positionPolicy == QWindowPrivate::WindowFrameInclusive;

    setFrameMarginsEnabled(true);
    setGeometryImpl(rect);

    m_normalGeometry = geometry();
}