Add a very basic x11/standalone platform plugin
The plugin does not much. It's the most basic plugin we can have to be loaded from kwin_x11. Unlike the wayland platform plugins it gets installed to: org.kde.kwin.platforms
This commit is contained in:
parent
33dffc0fd7
commit
ee89f3f34f
5 changed files with 111 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
add_subdirectory(standalone)
|
||||||
if(X11_XCB_FOUND)
|
if(X11_XCB_FOUND)
|
||||||
add_subdirectory(windowed)
|
add_subdirectory(windowed)
|
||||||
endif()
|
endif()
|
||||||
|
|
13
plugins/platforms/x11/standalone/CMakeLists.txt
Normal file
13
plugins/platforms/x11/standalone/CMakeLists.txt
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
set(X11PLATFORM_SOURCES
|
||||||
|
x11_platform.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(KWinX11Platform MODULE ${X11PLATFORM_SOURCES})
|
||||||
|
target_link_libraries(KWinX11Platform kwin Qt5::X11Extras)
|
||||||
|
|
||||||
|
install(
|
||||||
|
TARGETS
|
||||||
|
KWinX11Platform
|
||||||
|
DESTINATION
|
||||||
|
${PLUGIN_INSTALL_DIR}/org.kde.kwin.platforms/
|
||||||
|
)
|
8
plugins/platforms/x11/standalone/x11.json
Normal file
8
plugins/platforms/x11/standalone/x11.json
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"KPlugin": {
|
||||||
|
"Description": "Platform plugin for standalone x11 in kwin_x11.",
|
||||||
|
"Id": "KWinX11Platform",
|
||||||
|
"Name": "x11-standalone"
|
||||||
|
},
|
||||||
|
"input": true
|
||||||
|
}
|
44
plugins/platforms/x11/standalone/x11_platform.cpp
Normal file
44
plugins/platforms/x11/standalone/x11_platform.cpp
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
/********************************************************************
|
||||||
|
KWin - the KDE window manager
|
||||||
|
This file is part of the KDE project.
|
||||||
|
|
||||||
|
Copyright (C) 2016 Martin Gräßlin <mgraesslin@kde.org>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*********************************************************************/
|
||||||
|
#include "x11_platform.h"
|
||||||
|
|
||||||
|
#include <QX11Info>
|
||||||
|
|
||||||
|
namespace KWin
|
||||||
|
{
|
||||||
|
|
||||||
|
X11StandalonePlatform::X11StandalonePlatform(QObject *parent)
|
||||||
|
: Platform(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
X11StandalonePlatform::~X11StandalonePlatform() = default;
|
||||||
|
|
||||||
|
void X11StandalonePlatform::init()
|
||||||
|
{
|
||||||
|
if (!QX11Info::isPlatformX11()) {
|
||||||
|
emit initFailed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setReady(true);
|
||||||
|
emit screensQueried();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
45
plugins/platforms/x11/standalone/x11_platform.h
Normal file
45
plugins/platforms/x11/standalone/x11_platform.h
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
/********************************************************************
|
||||||
|
KWin - the KDE window manager
|
||||||
|
This file is part of the KDE project.
|
||||||
|
|
||||||
|
Copyright (C) 2016 Martin Gräßlin <mgraesslin@kde.org>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*********************************************************************/
|
||||||
|
#ifndef KWIN_X11STANDALONE_PLATFORM_H
|
||||||
|
#define KWIN_X11STANDALONE_PLATFORM_H
|
||||||
|
#include "platform.h"
|
||||||
|
|
||||||
|
#include <kwin_export.h>
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
namespace KWin
|
||||||
|
{
|
||||||
|
|
||||||
|
class KWIN_EXPORT X11StandalonePlatform : public Platform
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_INTERFACES(KWin::Platform)
|
||||||
|
Q_PLUGIN_METADATA(IID "org.kde.kwin.Platform" FILE "x11.json")
|
||||||
|
public:
|
||||||
|
X11StandalonePlatform(QObject *parent = nullptr);
|
||||||
|
virtual ~X11StandalonePlatform();
|
||||||
|
void init() override;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in a new issue