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

0001 /*
0002     SPDX-FileCopyrightText: 2023 Nicolas Fella <nicolas.fella@gmx.de>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #include "main.h"
0008 #include "plugin.h"
0009 
0010 #include "bouncekeys.h"
0011 
0012 class KWIN_EXPORT StickyKeysFactory : public KWin::PluginFactory
0013 {
0014     Q_OBJECT
0015     Q_PLUGIN_METADATA(IID PluginFactory_iid FILE "metadata.json")
0016     Q_INTERFACES(KWin::PluginFactory)
0017 
0018 public:
0019     std::unique_ptr<KWin::Plugin> create() const override
0020     {
0021         switch (KWin::kwinApp()->operationMode()) {
0022         case KWin::Application::OperationModeXwayland:
0023         case KWin::Application::OperationModeWaylandOnly:
0024             return std::make_unique<BounceKeysFilter>();
0025         case KWin::Application::OperationModeX11:
0026         default:
0027             return nullptr;
0028         }
0029     }
0030 };
0031 
0032 #include "main.moc"