Client: Move xdg-shell-v6 to a plugin
[ChangeLog][QPA plugin] The xdg-shell-v6 shell integration has been moved to a plugin. Change-Id: I548d19590ddbc8ad3e791301359a6de17ac9dcd8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
parent
4183147e80
commit
390856f452
@ -28,7 +28,6 @@ WAYLANDCLIENTSOURCES += \
|
|||||||
../extensions/qt-key-unstable-v1.xml \
|
../extensions/qt-key-unstable-v1.xml \
|
||||||
../extensions/qt-windowmanager.xml \
|
../extensions/qt-windowmanager.xml \
|
||||||
../3rdparty/protocol/text-input-unstable-v2.xml \
|
../3rdparty/protocol/text-input-unstable-v2.xml \
|
||||||
../3rdparty/protocol/xdg-shell-unstable-v6.xml \
|
|
||||||
|
|
||||||
WAYLANDCLIENTSOURCES_SYSTEM += \
|
WAYLANDCLIENTSOURCES_SYSTEM += \
|
||||||
../3rdparty/protocol/wayland.xml \
|
../3rdparty/protocol/wayland.xml \
|
||||||
@ -42,8 +41,6 @@ SOURCES += qwaylandintegration.cpp \
|
|||||||
qwaylandscreen.cpp \
|
qwaylandscreen.cpp \
|
||||||
qwaylandshmwindow.cpp \
|
qwaylandshmwindow.cpp \
|
||||||
qwaylandshellsurface.cpp \
|
qwaylandshellsurface.cpp \
|
||||||
qwaylandxdgshellv6.cpp \
|
|
||||||
qwaylandxdgshellv6integration.cpp \
|
|
||||||
qwaylandextendedsurface.cpp \
|
qwaylandextendedsurface.cpp \
|
||||||
qwaylandsubsurface.cpp \
|
qwaylandsubsurface.cpp \
|
||||||
qwaylandtouch.cpp \
|
qwaylandtouch.cpp \
|
||||||
@ -69,8 +66,6 @@ HEADERS += qwaylandintegration_p.h \
|
|||||||
qwaylandbuffer_p.h \
|
qwaylandbuffer_p.h \
|
||||||
qwaylandshmwindow_p.h \
|
qwaylandshmwindow_p.h \
|
||||||
qwaylandshellsurface_p.h \
|
qwaylandshellsurface_p.h \
|
||||||
qwaylandxdgshellv6_p.h \
|
|
||||||
qwaylandxdgshellv6integration_p.h \
|
|
||||||
qwaylandextendedsurface_p.h \
|
qwaylandextendedsurface_p.h \
|
||||||
qwaylandsubsurface_p.h \
|
qwaylandsubsurface_p.h \
|
||||||
qwaylandtouch_p.h \
|
qwaylandtouch_p.h \
|
||||||
|
@ -3,5 +3,6 @@ TEMPLATE = subdirs
|
|||||||
SUBDIRS += \
|
SUBDIRS += \
|
||||||
ivi-shell \
|
ivi-shell \
|
||||||
xdg-shell-v5 \
|
xdg-shell-v5 \
|
||||||
|
xdg-shell-v6 \
|
||||||
wl-shell \
|
wl-shell \
|
||||||
|
|
||||||
|
@ -0,0 +1,68 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2018 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 3 requirements
|
||||||
|
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 2.0 or (at your option) the GNU General
|
||||||
|
** Public license version 3 or any later version approved by the KDE Free
|
||||||
|
** Qt Foundation. The licenses are as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||||
|
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "qwaylandxdgshellv6integration_p.h"
|
||||||
|
|
||||||
|
#include <QtWaylandClient/private/qwaylandshellintegrationplugin_p.h>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
|
class QWaylandXdgShellV6IntegrationPlugin : public QWaylandShellIntegrationPlugin
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID QWaylandShellIntegrationFactoryInterface_iid FILE "xdg-shell-v6.json")
|
||||||
|
|
||||||
|
public:
|
||||||
|
QWaylandShellIntegration *create(const QString &key, const QStringList ¶mList) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
QWaylandShellIntegration *QWaylandXdgShellV6IntegrationPlugin::create(const QString &key, const QStringList ¶mList)
|
||||||
|
{
|
||||||
|
Q_UNUSED(key);
|
||||||
|
Q_UNUSED(paramList);
|
||||||
|
return new QWaylandXdgShellV6Integration();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
#include "main.moc"
|
@ -40,11 +40,11 @@
|
|||||||
|
|
||||||
#include "qwaylandxdgshellv6_p.h"
|
#include "qwaylandxdgshellv6_p.h"
|
||||||
|
|
||||||
#include "qwaylanddisplay_p.h"
|
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
|
||||||
#include "qwaylandwindow_p.h"
|
#include <QtWaylandClient/private/qwaylandwindow_p.h>
|
||||||
#include "qwaylandinputdevice_p.h"
|
#include <QtWaylandClient/private/qwaylandinputdevice_p.h>
|
||||||
#include "qwaylandscreen_p.h"
|
#include <QtWaylandClient/private/qwaylandscreen_p.h>
|
||||||
#include "qwaylandabstractdecoration_p.h"
|
#include <QtWaylandClient/private/qwaylandabstractdecoration_p.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
@ -52,15 +52,16 @@
|
|||||||
// We mean it.
|
// We mean it.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "qwayland-xdg-shell-unstable-v6.h"
|
||||||
|
|
||||||
|
#include <QtWaylandClient/qtwaylandclientglobal.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandshellsurface_p.h>
|
||||||
|
|
||||||
#include <QtCore/QSize>
|
#include <QtCore/QSize>
|
||||||
#include <QtGui/QRegion>
|
#include <QtGui/QRegion>
|
||||||
|
|
||||||
#include <wayland-client.h>
|
#include <wayland-client.h>
|
||||||
|
|
||||||
#include <QtWaylandClient/private/qwayland-xdg-shell-unstable-v6.h>
|
|
||||||
#include <QtWaylandClient/qtwaylandclientglobal.h>
|
|
||||||
#include "qwaylandshellsurface_p.h"
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QWindow;
|
class QWindow;
|
@ -41,39 +41,26 @@
|
|||||||
|
|
||||||
#include <QtWaylandClient/private/qwaylandwindow_p.h>
|
#include <QtWaylandClient/private/qwaylandwindow_p.h>
|
||||||
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
|
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
|
||||||
#include <QtWaylandClient/private/qwaylandxdgshellv6_p.h>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
QWaylandXdgShellV6Integration::QWaylandXdgShellV6Integration(QWaylandDisplay *display)
|
bool QWaylandXdgShellV6Integration::initialize(QWaylandDisplay *display)
|
||||||
{
|
{
|
||||||
for (QWaylandDisplay::RegistryGlobal global : display->globals()) {
|
for (QWaylandDisplay::RegistryGlobal global : display->globals()) {
|
||||||
if (global.interface == QLatin1String("zxdg_shell_v6")) {
|
if (global.interface == QLatin1String("zxdg_shell_v6")) {
|
||||||
m_xdgShell = new QWaylandXdgShellV6(display->wl_registry(), global.id, global.version);
|
m_xdgShell.reset(new QWaylandXdgShellV6(display->wl_registry(), global.id, global.version));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
QWaylandXdgShellV6Integration *QWaylandXdgShellV6Integration::create(QWaylandDisplay *display)
|
if (!m_xdgShell) {
|
||||||
{
|
qCDebug(lcQpaWayland) << "Couldn't find global zxdg_shell_v6 for xdg-shell unstable v6";
|
||||||
if (!display->hasRegistryGlobal(QLatin1String("zxdg_shell_v6")))
|
return false;
|
||||||
return nullptr;
|
}
|
||||||
|
|
||||||
QScopedPointer<QWaylandXdgShellV6Integration> integration;
|
return QWaylandShellIntegration::initialize(display);
|
||||||
integration.reset(new QWaylandXdgShellV6Integration(display));
|
|
||||||
if (integration && !integration->initialize(display))
|
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
return integration.take();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool QWaylandXdgShellV6Integration::initialize(QWaylandDisplay *display)
|
|
||||||
{
|
|
||||||
QWaylandShellIntegration::initialize(display);
|
|
||||||
return m_xdgShell != nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWaylandShellSurface *QWaylandXdgShellV6Integration::createShellSurface(QWaylandWindow *window)
|
QWaylandShellSurface *QWaylandXdgShellV6Integration::createShellSurface(QWaylandWindow *window)
|
@ -51,7 +51,7 @@
|
|||||||
// We mean it.
|
// We mean it.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <wayland-client.h>
|
#include "qwaylandxdgshellv6_p.h"
|
||||||
|
|
||||||
#include <QtWaylandClient/private/qwaylandshellintegration_p.h>
|
#include <QtWaylandClient/private/qwaylandshellintegration_p.h>
|
||||||
|
|
||||||
@ -59,20 +59,16 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
class QWaylandXdgShellV6;
|
|
||||||
|
|
||||||
class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgShellV6Integration : public QWaylandShellIntegration
|
class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgShellV6Integration : public QWaylandShellIntegration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static QWaylandXdgShellV6Integration *create(QWaylandDisplay* display);
|
QWaylandXdgShellV6Integration() {}
|
||||||
bool initialize(QWaylandDisplay *display) override;
|
bool initialize(QWaylandDisplay *display) override;
|
||||||
QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override;
|
QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override;
|
||||||
void handleKeyboardFocusChanged(QWaylandWindow *newFocus, QWaylandWindow *oldFocus) override;
|
void handleKeyboardFocusChanged(QWaylandWindow *newFocus, QWaylandWindow *oldFocus) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QWaylandXdgShellV6Integration(QWaylandDisplay *display);
|
QScopedPointer<QWaylandXdgShellV6> m_xdgShell;
|
||||||
|
|
||||||
QWaylandXdgShellV6 *m_xdgShell = nullptr;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"Keys":[ "xdg-shell-v6" ]
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
QT += gui-private waylandclient-private
|
||||||
|
CONFIG += wayland-scanner
|
||||||
|
|
||||||
|
QMAKE_USE += wayland-client
|
||||||
|
|
||||||
|
WAYLANDCLIENTSOURCES += \
|
||||||
|
../../../3rdparty/protocol/xdg-shell-unstable-v6.xml
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
qwaylandxdgshellv6_p.h \
|
||||||
|
qwaylandxdgshellv6integration_p.h \
|
||||||
|
|
||||||
|
SOURCES += \
|
||||||
|
main.cpp \
|
||||||
|
qwaylandxdgshellv6.cpp \
|
||||||
|
qwaylandxdgshellv6integration.cpp \
|
||||||
|
|
||||||
|
OTHER_FILES += \
|
||||||
|
xdg-shell-v6.json
|
||||||
|
|
||||||
|
PLUGIN_TYPE = wayland-shell-integration
|
||||||
|
PLUGIN_CLASS_NAME = QWaylandXdgShellV6IntegrationPlugin
|
||||||
|
load(qt_plugin)
|
@ -77,7 +77,6 @@
|
|||||||
|
|
||||||
#include "qwaylandshellintegration_p.h"
|
#include "qwaylandshellintegration_p.h"
|
||||||
#include "qwaylandshellintegrationfactory_p.h"
|
#include "qwaylandshellintegrationfactory_p.h"
|
||||||
#include "qwaylandxdgshellv6integration_p.h"
|
|
||||||
|
|
||||||
#include "qwaylandinputdeviceintegration_p.h"
|
#include "qwaylandinputdeviceintegration_p.h"
|
||||||
#include "qwaylandinputdeviceintegrationfactory_p.h"
|
#include "qwaylandinputdeviceintegrationfactory_p.h"
|
||||||
@ -441,9 +440,7 @@ void QWaylandIntegration::initializeInputDeviceIntegration()
|
|||||||
|
|
||||||
QWaylandShellIntegration *QWaylandIntegration::createShellIntegration(const QString &integrationName)
|
QWaylandShellIntegration *QWaylandIntegration::createShellIntegration(const QString &integrationName)
|
||||||
{
|
{
|
||||||
if (integrationName == QLatin1Literal("xdg-shell-v6")) {
|
if (QWaylandShellIntegrationFactory::keys().contains(integrationName)) {
|
||||||
return QWaylandXdgShellV6Integration::create(mDisplay.data());
|
|
||||||
} else if (QWaylandShellIntegrationFactory::keys().contains(integrationName)) {
|
|
||||||
return QWaylandShellIntegrationFactory::create(integrationName, mDisplay.data());
|
return QWaylandShellIntegrationFactory::create(integrationName, mDisplay.data());
|
||||||
} else {
|
} else {
|
||||||
qCWarning(lcQpaWayland) << "No shell integration named" << integrationName << "found";
|
qCWarning(lcQpaWayland) << "No shell integration named" << integrationName << "found";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user