diff options
-rw-r--r-- | src/client/client.pro | 5 | ||||
-rw-r--r-- | src/client/qwaylandintegration.cpp | 5 | ||||
-rw-r--r-- | src/plugins/shellintegration/shellintegration.pro | 1 | ||||
-rw-r--r-- | src/plugins/shellintegration/xdg-shell-v6/main.cpp | 68 | ||||
-rw-r--r-- | src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp (renamed from src/client/qwaylandxdgshellv6.cpp) | 10 | ||||
-rw-r--r-- | src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h (renamed from src/client/qwaylandxdgshellv6_p.h) | 9 | ||||
-rw-r--r-- | src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6integration.cpp (renamed from src/client/qwaylandxdgshellv6integration.cpp) | 27 | ||||
-rw-r--r-- | src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6integration_p.h (renamed from src/client/qwaylandxdgshellv6integration_p.h) | 10 | ||||
-rw-r--r-- | src/plugins/shellintegration/xdg-shell-v6/xdg-shell-v6.json | 3 | ||||
-rw-r--r-- | src/plugins/shellintegration/xdg-shell-v6/xdg-shell-v6.pro | 23 |
10 files changed, 116 insertions, 45 deletions
diff --git a/src/client/client.pro b/src/client/client.pro index 3b11902de..593e8daf6 100644 --- a/src/client/client.pro +++ b/src/client/client.pro @@ -28,7 +28,6 @@ WAYLANDCLIENTSOURCES += \ ../extensions/qt-key-unstable-v1.xml \ ../extensions/qt-windowmanager.xml \ ../3rdparty/protocol/text-input-unstable-v2.xml \ - ../3rdparty/protocol/xdg-shell-unstable-v6.xml \ WAYLANDCLIENTSOURCES_SYSTEM += \ ../3rdparty/protocol/wayland.xml \ @@ -42,8 +41,6 @@ SOURCES += qwaylandintegration.cpp \ qwaylandscreen.cpp \ qwaylandshmwindow.cpp \ qwaylandshellsurface.cpp \ - qwaylandxdgshellv6.cpp \ - qwaylandxdgshellv6integration.cpp \ qwaylandextendedsurface.cpp \ qwaylandsubsurface.cpp \ qwaylandtouch.cpp \ @@ -69,8 +66,6 @@ HEADERS += qwaylandintegration_p.h \ qwaylandbuffer_p.h \ qwaylandshmwindow_p.h \ qwaylandshellsurface_p.h \ - qwaylandxdgshellv6_p.h \ - qwaylandxdgshellv6integration_p.h \ qwaylandextendedsurface_p.h \ qwaylandsubsurface_p.h \ qwaylandtouch_p.h \ diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index fbfdd57f4..6ab5f0f20 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -77,7 +77,6 @@ #include "qwaylandshellintegration_p.h" #include "qwaylandshellintegrationfactory_p.h" -#include "qwaylandxdgshellv6integration_p.h" #include "qwaylandinputdeviceintegration_p.h" #include "qwaylandinputdeviceintegrationfactory_p.h" @@ -441,9 +440,7 @@ void QWaylandIntegration::initializeInputDeviceIntegration() QWaylandShellIntegration *QWaylandIntegration::createShellIntegration(const QString &integrationName) { - if (integrationName == QLatin1Literal("xdg-shell-v6")) { - return QWaylandXdgShellV6Integration::create(mDisplay.data()); - } else if (QWaylandShellIntegrationFactory::keys().contains(integrationName)) { + if (QWaylandShellIntegrationFactory::keys().contains(integrationName)) { return QWaylandShellIntegrationFactory::create(integrationName, mDisplay.data()); } else { qCWarning(lcQpaWayland) << "No shell integration named" << integrationName << "found"; diff --git a/src/plugins/shellintegration/shellintegration.pro b/src/plugins/shellintegration/shellintegration.pro index 12a900db2..9be4e82a5 100644 --- a/src/plugins/shellintegration/shellintegration.pro +++ b/src/plugins/shellintegration/shellintegration.pro @@ -3,5 +3,6 @@ TEMPLATE = subdirs SUBDIRS += \ ivi-shell \ xdg-shell-v5 \ + xdg-shell-v6 \ wl-shell \ diff --git a/src/plugins/shellintegration/xdg-shell-v6/main.cpp b/src/plugins/shellintegration/xdg-shell-v6/main.cpp new file mode 100644 index 000000000..8cd302f32 --- /dev/null +++ b/src/plugins/shellintegration/xdg-shell-v6/main.cpp @@ -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" diff --git a/src/client/qwaylandxdgshellv6.cpp b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp index beabddbbb..550575f11 100644 --- a/src/client/qwaylandxdgshellv6.cpp +++ b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp @@ -40,11 +40,11 @@ #include "qwaylandxdgshellv6_p.h" -#include "qwaylanddisplay_p.h" -#include "qwaylandwindow_p.h" -#include "qwaylandinputdevice_p.h" -#include "qwaylandscreen_p.h" -#include "qwaylandabstractdecoration_p.h" +#include <QtWaylandClient/private/qwaylanddisplay_p.h> +#include <QtWaylandClient/private/qwaylandwindow_p.h> +#include <QtWaylandClient/private/qwaylandinputdevice_p.h> +#include <QtWaylandClient/private/qwaylandscreen_p.h> +#include <QtWaylandClient/private/qwaylandabstractdecoration_p.h> QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandxdgshellv6_p.h b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h index d2448bc66..574e6dd9f 100644 --- a/src/client/qwaylandxdgshellv6_p.h +++ b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h @@ -52,15 +52,16 @@ // We mean it. // +#include "qwayland-xdg-shell-unstable-v6.h" + +#include <QtWaylandClient/qtwaylandclientglobal.h> +#include <QtWaylandClient/private/qwaylandshellsurface_p.h> + #include <QtCore/QSize> #include <QtGui/QRegion> #include <wayland-client.h> -#include <QtWaylandClient/private/qwayland-xdg-shell-unstable-v6.h> -#include <QtWaylandClient/qtwaylandclientglobal.h> -#include "qwaylandshellsurface_p.h" - QT_BEGIN_NAMESPACE class QWindow; diff --git a/src/client/qwaylandxdgshellv6integration.cpp b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6integration.cpp index 0eb6b5929..031643165 100644 --- a/src/client/qwaylandxdgshellv6integration.cpp +++ b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6integration.cpp @@ -41,39 +41,26 @@ #include <QtWaylandClient/private/qwaylandwindow_p.h> #include <QtWaylandClient/private/qwaylanddisplay_p.h> -#include <QtWaylandClient/private/qwaylandxdgshellv6_p.h> QT_BEGIN_NAMESPACE namespace QtWaylandClient { -QWaylandXdgShellV6Integration::QWaylandXdgShellV6Integration(QWaylandDisplay *display) +bool QWaylandXdgShellV6Integration::initialize(QWaylandDisplay *display) { for (QWaylandDisplay::RegistryGlobal global : display->globals()) { 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; } } -} - -QWaylandXdgShellV6Integration *QWaylandXdgShellV6Integration::create(QWaylandDisplay *display) -{ - if (!display->hasRegistryGlobal(QLatin1String("zxdg_shell_v6"))) - return nullptr; - - QScopedPointer<QWaylandXdgShellV6Integration> integration; - integration.reset(new QWaylandXdgShellV6Integration(display)); - if (integration && !integration->initialize(display)) - return nullptr; - return integration.take(); -} + if (!m_xdgShell) { + qCDebug(lcQpaWayland) << "Couldn't find global zxdg_shell_v6 for xdg-shell unstable v6"; + return false; + } -bool QWaylandXdgShellV6Integration::initialize(QWaylandDisplay *display) -{ - QWaylandShellIntegration::initialize(display); - return m_xdgShell != nullptr; + return QWaylandShellIntegration::initialize(display); } QWaylandShellSurface *QWaylandXdgShellV6Integration::createShellSurface(QWaylandWindow *window) diff --git a/src/client/qwaylandxdgshellv6integration_p.h b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6integration_p.h index 66323a775..261f8cbb4 100644 --- a/src/client/qwaylandxdgshellv6integration_p.h +++ b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6integration_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include <wayland-client.h> +#include "qwaylandxdgshellv6_p.h" #include <QtWaylandClient/private/qwaylandshellintegration_p.h> @@ -59,20 +59,16 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -class QWaylandXdgShellV6; - class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgShellV6Integration : public QWaylandShellIntegration { public: - static QWaylandXdgShellV6Integration *create(QWaylandDisplay* display); + QWaylandXdgShellV6Integration() {} bool initialize(QWaylandDisplay *display) override; QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override; void handleKeyboardFocusChanged(QWaylandWindow *newFocus, QWaylandWindow *oldFocus) override; private: - QWaylandXdgShellV6Integration(QWaylandDisplay *display); - - QWaylandXdgShellV6 *m_xdgShell = nullptr; + QScopedPointer<QWaylandXdgShellV6> m_xdgShell; }; } diff --git a/src/plugins/shellintegration/xdg-shell-v6/xdg-shell-v6.json b/src/plugins/shellintegration/xdg-shell-v6/xdg-shell-v6.json new file mode 100644 index 000000000..b1b8db31b --- /dev/null +++ b/src/plugins/shellintegration/xdg-shell-v6/xdg-shell-v6.json @@ -0,0 +1,3 @@ +{ + "Keys":[ "xdg-shell-v6" ] +} diff --git a/src/plugins/shellintegration/xdg-shell-v6/xdg-shell-v6.pro b/src/plugins/shellintegration/xdg-shell-v6/xdg-shell-v6.pro new file mode 100644 index 000000000..a5e0a5105 --- /dev/null +++ b/src/plugins/shellintegration/xdg-shell-v6/xdg-shell-v6.pro @@ -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) |