File indexing completed on 2024-11-10 04:57:05

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #include "integration.h"
0010 #include <qpa/qplatformintegrationplugin.h>
0011 
0012 #include <QCoreApplication>
0013 
0014 class KWinIntegrationPlugin : public QPlatformIntegrationPlugin
0015 {
0016     Q_OBJECT
0017     Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "kwin.json")
0018 public:
0019     using QPlatformIntegrationPlugin::create;
0020     QPlatformIntegration *create(const QString &system, const QStringList &paramList) override;
0021 };
0022 
0023 QPlatformIntegration *KWinIntegrationPlugin::create(const QString &system, const QStringList &paramList)
0024 {
0025     if (!QCoreApplication::applicationFilePath().endsWith(QLatin1String("kwin_wayland")) && !qEnvironmentVariableIsSet("KWIN_FORCE_OWN_QPA")) {
0026         // Not KWin
0027         return nullptr;
0028     }
0029     if (system.compare(QLatin1String("wayland-org.kde.kwin.qpa"), Qt::CaseInsensitive) == 0) {
0030         // create our integration
0031         return new KWin::QPA::Integration;
0032     }
0033     return nullptr;
0034 }
0035 
0036 #include "main.moc"