当前位置: 首页>>代码示例>>C++>>正文


C++ Compositor::setFakeScreenConfiguration方法代码示例

本文整理汇总了C++中Compositor::setFakeScreenConfiguration方法的典型用法代码示例。如果您正苦于以下问题:C++ Compositor::setFakeScreenConfiguration方法的具体用法?C++ Compositor::setFakeScreenConfiguration怎么用?C++ Compositor::setFakeScreenConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Compositor的用法示例。


在下文中一共展示了Compositor::setFakeScreenConfiguration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: run

bool HomeApplication::run(const QString &shell)
{
    // If a compositor is already running we cannot continue
    if (Compositor::instance()->isRunning()) {
        qCWarning(GREENISLAND_COMPOSITOR) << "Compositor already running, don't call run() more than once!";
        return false;
    }

    // Set plugin
    GreenIsland::Compositor::s_fixedShell = shell;

    // Check whether XDG_RUNTIME_DIR is ok or not
    GreenIsland::verifyXdgRuntimeDir();

    // If a socket is passed it means that we are nesting into
    // another compositor, let's do some checks
    if (!m_socket.isEmpty()) {
        // We need wayland QPA plugin
        if (!QGuiApplication::platformName().startsWith(QStringLiteral("wayland"))) {
            qCWarning(GREENISLAND_COMPOSITOR)
                    << "By passing the \"--socket\" argument you are requesting to nest"
                    << "this compositor into another, but you forgot to pass "
                    << "also \"-platform wayland\"!";
#if HAVE_SYSTEMD
            if (m_notify)
                sd_notifyf(0, "STATUS=Nesting requested, but no wayland QPA");
#endif
            return false;
        }
    }

    // Screen configuration
    if (!m_fakeScreenFileName.isEmpty()) {
        // Need the native backend
        if (QGuiApplication::platformName().startsWith(QStringLiteral("wayland"))) {
            qCWarning(GREENISLAND_COMPOSITOR)
                    << "Fake screen configuration is not allowed when Green Island"
                    << "is nested into another compositor";
#if HAVE_SYSTEMD
            if (m_notify)
                sd_notifyf(0, "STATUS=Fake screen configuration not allowed when nested");
#endif
            return false;
        }
    }

    // Create the compositor
    Compositor *compositor = Compositor::instance();
    if (!m_fakeScreenFileName.isEmpty())
        compositor->setFakeScreenConfiguration(m_fakeScreenFileName);
    QObject::connect(compositor, &Compositor::screenConfigurationAcquired, [this] {
#if HAVE_SYSTEMD
        // Notify systemd when the screen configuration is ready
        if (m_notify) {
            qCDebug(GREENISLAND_COMPOSITOR) << "Compositor ready, notify systemd on" << qgetenv("NOTIFY_SOCKET");
            sd_notify(0, "READY=1");
        }
#endif
    });
    compositor->run();
    compositorLaunched();

    return true;
}
开发者ID:hbarve1,项目名称:greenisland,代码行数:64,代码来源:homeapplication.cpp


注:本文中的Compositor::setFakeScreenConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。