Move xdg-shell-v5 to a plugin
This is the first step in deprecating xdg-shell unstable v5 and making the good names available for the good names for xdg-shell stable. Shell initialization has been refactored slightly, so the QWaylandShellIntegrationFactory actually tries to initialize the shell integration before returning it. Similarly for the factory method of non-plugin shells. Change-Id: I85e60594c4fc03c6f302c04316110aed428d28dc Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
parent
4f292a1226
commit
7ef6c33a69
@ -28,7 +28,6 @@ WAYLANDCLIENTSOURCES += \
|
|||||||
../extensions/qtkey-extension.xml \
|
../extensions/qtkey-extension.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.xml \
|
|
||||||
../3rdparty/protocol/xdg-shell-unstable-v6.xml \
|
../3rdparty/protocol/xdg-shell-unstable-v6.xml \
|
||||||
|
|
||||||
WAYLANDCLIENTSOURCES_SYSTEM += \
|
WAYLANDCLIENTSOURCES_SYSTEM += \
|
||||||
@ -45,10 +44,6 @@ SOURCES += qwaylandintegration.cpp \
|
|||||||
qwaylandshellsurface.cpp \
|
qwaylandshellsurface.cpp \
|
||||||
qwaylandwlshellsurface.cpp \
|
qwaylandwlshellsurface.cpp \
|
||||||
qwaylandwlshellintegration.cpp \
|
qwaylandwlshellintegration.cpp \
|
||||||
qwaylandxdgshell.cpp \
|
|
||||||
qwaylandxdgsurface.cpp \
|
|
||||||
qwaylandxdgpopup.cpp \
|
|
||||||
qwaylandxdgshellintegration.cpp \
|
|
||||||
qwaylandxdgshellv6.cpp \
|
qwaylandxdgshellv6.cpp \
|
||||||
qwaylandxdgshellv6integration.cpp \
|
qwaylandxdgshellv6integration.cpp \
|
||||||
qwaylandextendedsurface.cpp \
|
qwaylandextendedsurface.cpp \
|
||||||
@ -78,10 +73,6 @@ HEADERS += qwaylandintegration_p.h \
|
|||||||
qwaylandshellsurface_p.h \
|
qwaylandshellsurface_p.h \
|
||||||
qwaylandwlshellsurface_p.h \
|
qwaylandwlshellsurface_p.h \
|
||||||
qwaylandwlshellintegration_p.h \
|
qwaylandwlshellintegration_p.h \
|
||||||
qwaylandxdgshell_p.h \
|
|
||||||
qwaylandxdgsurface_p.h \
|
|
||||||
qwaylandxdgpopup_p.h \
|
|
||||||
qwaylandxdgshellintegration_p.h \
|
|
||||||
qwaylandxdgshellv6_p.h \
|
qwaylandxdgshellv6_p.h \
|
||||||
qwaylandxdgshellv6integration_p.h \
|
qwaylandxdgshellv6integration_p.h \
|
||||||
qwaylandextendedsurface_p.h \
|
qwaylandextendedsurface_p.h \
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
TEMPLATE = subdirs
|
TEMPLATE = subdirs
|
||||||
|
|
||||||
SUBDIRS += ivi-shell
|
SUBDIRS += \
|
||||||
|
ivi-shell \
|
||||||
|
xdg-shell-v5
|
||||||
|
@ -0,0 +1,70 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2018 The Qt Company Ltd.
|
||||||
|
** Copyright (C) 2017 ITAGE Corporation, author: <yusuke.binsaki@itage.co.jp>
|
||||||
|
** 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 "qwaylandxdgshellintegration_p.h"
|
||||||
|
|
||||||
|
#include <QtWaylandClient/private/qwaylandshellintegrationplugin_p.h>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
|
class QWaylandXdgShellV5IntegrationPlugin : public QWaylandShellIntegrationPlugin
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID QWaylandShellIntegrationFactoryInterface_iid FILE "xdg-shell-v5.json")
|
||||||
|
|
||||||
|
public:
|
||||||
|
QWaylandShellIntegration *create(const QString &key, const QStringList ¶mList) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
QWaylandShellIntegration *QWaylandXdgShellV5IntegrationPlugin::create(const QString &key, const QStringList ¶mList)
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
Q_UNUSED(key);
|
||||||
|
Q_UNUSED(paramList);
|
||||||
|
return new QWaylandXdgShellIntegration();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
#include "main.moc"
|
@ -39,9 +39,9 @@
|
|||||||
|
|
||||||
#include "qwaylandxdgpopup_p.h"
|
#include "qwaylandxdgpopup_p.h"
|
||||||
|
|
||||||
#include "qwaylandwindow_p.h"
|
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
|
||||||
#include "qwaylanddisplay_p.h"
|
#include <QtWaylandClient/private/qwaylandwindow_p.h>
|
||||||
#include "qwaylandextendedsurface_p.h"
|
#include <QtWaylandClient/private/qwaylandextendedsurface_p.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
@ -51,10 +51,11 @@
|
|||||||
// We mean it.
|
// We mean it.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "qwayland-xdg-shell.h"
|
||||||
|
|
||||||
#include <wayland-client.h>
|
#include <wayland-client.h>
|
||||||
|
|
||||||
#include <QtWaylandClient/qtwaylandclientglobal.h>
|
#include <QtWaylandClient/qtwaylandclientglobal.h>
|
||||||
#include <QtWaylandClient/private/qwayland-xdg-shell.h>
|
|
||||||
#include <QtWaylandClient/private/qwaylandshellsurface_p.h>
|
#include <QtWaylandClient/private/qwaylandshellsurface_p.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
@ -38,16 +38,16 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qwaylandxdgshell_p.h"
|
#include "qwaylandxdgshell_p.h"
|
||||||
|
|
||||||
#include "qwaylanddisplay_p.h"
|
|
||||||
#include "qwaylandwindow_p.h"
|
|
||||||
#include "qwaylandinputdevice_p.h"
|
|
||||||
#include "qwaylandscreen_p.h"
|
|
||||||
#include "qwaylandxdgpopup_p.h"
|
#include "qwaylandxdgpopup_p.h"
|
||||||
#include "qwaylandxdgsurface_p.h"
|
#include "qwaylandxdgsurface_p.h"
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
|
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandwindow_p.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandinputdevice_p.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandscreen_p.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
@ -51,12 +51,13 @@
|
|||||||
// We mean it.
|
// We mean it.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "qwayland-xdg-shell.h"
|
||||||
|
|
||||||
#include <QtCore/QSize>
|
#include <QtCore/QSize>
|
||||||
#include <QtCore/QVector>
|
#include <QtCore/QVector>
|
||||||
|
|
||||||
#include <wayland-client.h>
|
#include <wayland-client.h>
|
||||||
|
|
||||||
#include <QtWaylandClient/private/qwayland-xdg-shell.h>
|
|
||||||
#include <QtWaylandClient/qtwaylandclientglobal.h>
|
#include <QtWaylandClient/qtwaylandclientglobal.h>
|
||||||
#include <QtWaylandClient/private/qwaylandshellsurface_p.h>
|
#include <QtWaylandClient/private/qwaylandshellsurface_p.h>
|
||||||
|
|
@ -38,38 +38,32 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qwaylandxdgshellintegration_p.h"
|
#include "qwaylandxdgshellintegration_p.h"
|
||||||
|
#include "qwaylandxdgsurface_p.h"
|
||||||
|
#include "qwaylandxdgpopup_p.h"
|
||||||
|
#include "qwaylandxdgshell_p.h"
|
||||||
|
|
||||||
#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/qwaylandxdgsurface_p.h>
|
|
||||||
#include <QtWaylandClient/private/qwaylandxdgpopup_p.h>
|
|
||||||
#include <QtWaylandClient/private/qwaylandxdgshell_p.h>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
QWaylandXdgShellIntegration *QWaylandXdgShellIntegration::create(QWaylandDisplay *display)
|
bool QWaylandXdgShellIntegration::initialize(QWaylandDisplay *display)
|
||||||
{
|
|
||||||
if (display->hasRegistryGlobal(QLatin1String("xdg_shell")))
|
|
||||||
return new QWaylandXdgShellIntegration(display);
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
QWaylandXdgShellIntegration::QWaylandXdgShellIntegration(QWaylandDisplay *display)
|
|
||||||
{
|
{
|
||||||
Q_FOREACH (QWaylandDisplay::RegistryGlobal global, display->globals()) {
|
Q_FOREACH (QWaylandDisplay::RegistryGlobal global, display->globals()) {
|
||||||
if (global.interface == QLatin1String("xdg_shell")) {
|
if (global.interface == QLatin1String("xdg_shell")) {
|
||||||
m_xdgShell = new QWaylandXdgShell(display->wl_registry(), global.id);
|
m_xdgShell.reset(new QWaylandXdgShell(display->wl_registry(), global.id));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bool QWaylandXdgShellIntegration::initialize(QWaylandDisplay *display)
|
if (!m_xdgShell) {
|
||||||
{
|
qWarning() << "Couldn't find global xdg_shell for xdg-shell unstable v5";
|
||||||
QWaylandShellIntegration::initialize(display);
|
return false;
|
||||||
return m_xdgShell != nullptr;
|
}
|
||||||
|
|
||||||
|
return QWaylandShellIntegration::initialize(display);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWaylandShellSurface *QWaylandXdgShellIntegration::createShellSurface(QWaylandWindow *window)
|
QWaylandShellSurface *QWaylandXdgShellIntegration::createShellSurface(QWaylandWindow *window)
|
@ -51,7 +51,7 @@
|
|||||||
// We mean it.
|
// We mean it.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <wayland-client.h>
|
#include "qwaylandxdgshell_p.h"
|
||||||
|
|
||||||
#include <QtWaylandClient/private/qwaylandshellintegration_p.h>
|
#include <QtWaylandClient/private/qwaylandshellintegration_p.h>
|
||||||
|
|
||||||
@ -64,15 +64,13 @@ class QWaylandXdgShell;
|
|||||||
class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgShellIntegration : public QWaylandShellIntegration
|
class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgShellIntegration : public QWaylandShellIntegration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static QWaylandXdgShellIntegration *create(QWaylandDisplay* display);
|
QWaylandXdgShellIntegration() {qDebug() << Q_FUNC_INFO;}
|
||||||
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:
|
||||||
QWaylandXdgShellIntegration(QWaylandDisplay *display);
|
QScopedPointer<QWaylandXdgShell> m_xdgShell;
|
||||||
|
|
||||||
QWaylandXdgShell *m_xdgShell = nullptr;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2018 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the config.tests of the Qt Toolkit.
|
** This file is part of the config.tests of the Qt Toolkit.
|
||||||
@ -38,15 +38,15 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qwaylandxdgsurface_p.h"
|
#include "qwaylandxdgsurface_p.h"
|
||||||
|
|
||||||
#include "qwaylanddisplay_p.h"
|
|
||||||
#include "qwaylandwindow_p.h"
|
|
||||||
#include "qwaylandinputdevice_p.h"
|
|
||||||
#include "qwaylandabstractdecoration_p.h"
|
|
||||||
#include "qwaylandscreen_p.h"
|
|
||||||
#include "qwaylandextendedsurface_p.h"
|
|
||||||
#include "qwaylandxdgshell_p.h"
|
#include "qwaylandxdgshell_p.h"
|
||||||
|
|
||||||
|
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandwindow_p.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandinputdevice_p.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandabstractdecoration_p.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandscreen_p.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandextendedsurface_p.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
@ -51,15 +51,16 @@
|
|||||||
// We mean it.
|
// We mean it.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "qwayland-xdg-shell.h"
|
||||||
|
|
||||||
|
#include <QtWaylandClient/qtwaylandclientglobal.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandshellsurface_p.h>
|
||||||
|
|
||||||
#include <QtCore/QSize>
|
#include <QtCore/QSize>
|
||||||
#include <QtCore/QMargins>
|
#include <QtCore/QMargins>
|
||||||
|
|
||||||
#include <wayland-client.h>
|
#include <wayland-client.h>
|
||||||
|
|
||||||
#include <QtWaylandClient/qtwaylandclientglobal.h>
|
|
||||||
#include <QtWaylandClient/private/qwayland-xdg-shell.h>
|
|
||||||
#include <QtWaylandClient/private/qwaylandshellsurface_p.h>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QWindow;
|
class QWindow;
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"Keys":[ "xdg-shell-v5" ]
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
QT += gui-private waylandclient-private
|
||||||
|
CONFIG += wayland-scanner
|
||||||
|
|
||||||
|
QMAKE_USE += wayland-client
|
||||||
|
|
||||||
|
qtConfig(xkbcommon-evdev): \
|
||||||
|
QMAKE_USE += xkbcommon_evdev
|
||||||
|
|
||||||
|
WAYLANDCLIENTSOURCES += \
|
||||||
|
../../../3rdparty/protocol/xdg-shell.xml
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
qwaylandxdgpopup_p.h \
|
||||||
|
qwaylandxdgshell_p.h \
|
||||||
|
qwaylandxdgshellintegration_p.h \
|
||||||
|
qwaylandxdgsurface_p.h \
|
||||||
|
|
||||||
|
SOURCES += \
|
||||||
|
main.cpp \
|
||||||
|
qwaylandxdgpopup.cpp \
|
||||||
|
qwaylandxdgshell.cpp \
|
||||||
|
qwaylandxdgshellintegration.cpp \
|
||||||
|
qwaylandxdgsurface.cpp \
|
||||||
|
|
||||||
|
OTHER_FILES += \
|
||||||
|
xdg-shell-v5.json
|
||||||
|
|
||||||
|
PLUGIN_TYPE = wayland-shell-integration
|
||||||
|
PLUGIN_CLASS_NAME = QWaylandXdgShellV5IntegrationPlugin
|
||||||
|
load(qt_plugin)
|
@ -51,8 +51,6 @@
|
|||||||
#include "qwaylanddatadevicemanager_p.h"
|
#include "qwaylanddatadevicemanager_p.h"
|
||||||
#endif
|
#endif
|
||||||
#include "qwaylandhardwareintegration_p.h"
|
#include "qwaylandhardwareintegration_p.h"
|
||||||
#include "qwaylandxdgshell_p.h"
|
|
||||||
#include "qwaylandxdgsurface_p.h"
|
|
||||||
#include "qwaylandwlshellsurface_p.h"
|
#include "qwaylandwlshellsurface_p.h"
|
||||||
#include "qwaylandinputcontext_p.h"
|
#include "qwaylandinputcontext_p.h"
|
||||||
|
|
||||||
@ -66,7 +64,6 @@
|
|||||||
#include "qwaylandqtkey_p.h"
|
#include "qwaylandqtkey_p.h"
|
||||||
|
|
||||||
#include <QtWaylandClient/private/qwayland-text-input-unstable-v2.h>
|
#include <QtWaylandClient/private/qwayland-text-input-unstable-v2.h>
|
||||||
#include <QtWaylandClient/private/qwayland-xdg-shell.h>
|
|
||||||
|
|
||||||
#include <QtCore/QAbstractEventDispatcher>
|
#include <QtCore/QAbstractEventDispatcher>
|
||||||
#include <QtGui/private/qguiapplication_p.h>
|
#include <QtGui/private/qguiapplication_p.h>
|
||||||
|
@ -63,7 +63,6 @@
|
|||||||
|
|
||||||
#include <QtWaylandClient/private/qwayland-wayland.h>
|
#include <QtWaylandClient/private/qwayland-wayland.h>
|
||||||
#include <QtWaylandClient/private/qtwaylandclientglobal_p.h>
|
#include <QtWaylandClient/private/qtwaylandclientglobal_p.h>
|
||||||
#include <QtWaylandClient/private/qwayland-xdg-shell.h>
|
|
||||||
#include <QtWaylandClient/private/qwaylandshm_p.h>
|
#include <QtWaylandClient/private/qwaylandshm_p.h>
|
||||||
|
|
||||||
struct wl_cursor_image;
|
struct wl_cursor_image;
|
||||||
|
@ -77,7 +77,6 @@
|
|||||||
|
|
||||||
#include "qwaylandshellintegration_p.h"
|
#include "qwaylandshellintegration_p.h"
|
||||||
#include "qwaylandshellintegrationfactory_p.h"
|
#include "qwaylandshellintegrationfactory_p.h"
|
||||||
#include "qwaylandxdgshellintegration_p.h"
|
|
||||||
#include "qwaylandwlshellintegration_p.h"
|
#include "qwaylandwlshellintegration_p.h"
|
||||||
#include "qwaylandxdgshellv6integration_p.h"
|
#include "qwaylandxdgshellv6integration_p.h"
|
||||||
|
|
||||||
@ -409,9 +408,9 @@ void QWaylandIntegration::initializeShellIntegration()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mShellIntegration || !mShellIntegration->initialize(mDisplay.data())) {
|
if (!mShellIntegration) {
|
||||||
mShellIntegration.reset();
|
qCWarning(lcQpaWayland) << "Loading shell integration failed.";
|
||||||
qWarning("Failed to load shell integration %s", qPrintable(targetKey));
|
qCWarning(lcQpaWayland) << "Attempted to load the following shells" << preferredShells;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,13 +444,12 @@ QWaylandShellIntegration *QWaylandIntegration::createShellIntegration(const QStr
|
|||||||
{
|
{
|
||||||
if (integrationName == QLatin1Literal("wl-shell")) {
|
if (integrationName == QLatin1Literal("wl-shell")) {
|
||||||
return QWaylandWlShellIntegration::create(mDisplay.data());
|
return QWaylandWlShellIntegration::create(mDisplay.data());
|
||||||
} else if (integrationName == QLatin1Literal("xdg-shell-v5")) {
|
|
||||||
return QWaylandXdgShellIntegration::create(mDisplay.data());
|
|
||||||
} else if (integrationName == QLatin1Literal("xdg-shell-v6")) {
|
} else if (integrationName == QLatin1Literal("xdg-shell-v6")) {
|
||||||
return QWaylandXdgShellV6Integration::create(mDisplay.data());
|
return QWaylandXdgShellV6Integration::create(mDisplay.data());
|
||||||
} else if (QWaylandShellIntegrationFactory::keys().contains(integrationName)) {
|
} else if (QWaylandShellIntegrationFactory::keys().contains(integrationName)) {
|
||||||
return QWaylandShellIntegrationFactory::create(integrationName, QStringList());
|
return QWaylandShellIntegrationFactory::create(integrationName, mDisplay.data());
|
||||||
} else {
|
} else {
|
||||||
|
qCWarning(lcQpaWayland) << "No shell integration named" << integrationName << "found";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,6 @@
|
|||||||
#include "qwaylandscreen_p.h"
|
#include "qwaylandscreen_p.h"
|
||||||
#include "qwaylandshellsurface_p.h"
|
#include "qwaylandshellsurface_p.h"
|
||||||
#include "qwaylandwlshellsurface_p.h"
|
#include "qwaylandwlshellsurface_p.h"
|
||||||
#include "qwaylandxdgsurface_p.h"
|
|
||||||
#include "qwaylandsubsurface_p.h"
|
#include "qwaylandsubsurface_p.h"
|
||||||
#include "qwaylandabstractdecoration_p.h"
|
#include "qwaylandabstractdecoration_p.h"
|
||||||
#include "qwaylandwindowmanagerintegration_p.h"
|
#include "qwaylandwindowmanagerintegration_p.h"
|
||||||
|
@ -49,9 +49,15 @@ namespace QtWaylandClient {
|
|||||||
|
|
||||||
QWaylandWlShellIntegration *QWaylandWlShellIntegration::create(QWaylandDisplay *display)
|
QWaylandWlShellIntegration *QWaylandWlShellIntegration::create(QWaylandDisplay *display)
|
||||||
{
|
{
|
||||||
if (display->hasRegistryGlobal(QLatin1String("wl_shell")))
|
if (!display->hasRegistryGlobal(QLatin1String("wl_shell")))
|
||||||
return new QWaylandWlShellIntegration(display);
|
return nullptr;
|
||||||
return nullptr;
|
|
||||||
|
QScopedPointer<QWaylandWlShellIntegration> integration;
|
||||||
|
integration.reset(new QWaylandWlShellIntegration(display));
|
||||||
|
if (integration && !integration->initialize(display))
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
return integration.take();
|
||||||
}
|
}
|
||||||
|
|
||||||
QWaylandWlShellIntegration::QWaylandWlShellIntegration(QWaylandDisplay *display)
|
QWaylandWlShellIntegration::QWaylandWlShellIntegration(QWaylandDisplay *display)
|
||||||
|
@ -59,9 +59,15 @@ QWaylandXdgShellV6Integration::QWaylandXdgShellV6Integration(QWaylandDisplay *di
|
|||||||
|
|
||||||
QWaylandXdgShellV6Integration *QWaylandXdgShellV6Integration::create(QWaylandDisplay *display)
|
QWaylandXdgShellV6Integration *QWaylandXdgShellV6Integration::create(QWaylandDisplay *display)
|
||||||
{
|
{
|
||||||
if (display->hasRegistryGlobal(QLatin1String("zxdg_shell_v6")))
|
if (!display->hasRegistryGlobal(QLatin1String("zxdg_shell_v6")))
|
||||||
return new QWaylandXdgShellV6Integration(display);
|
return nullptr;
|
||||||
return nullptr;
|
|
||||||
|
QScopedPointer<QWaylandXdgShellV6Integration> integration;
|
||||||
|
integration.reset(new QWaylandXdgShellV6Integration(display));
|
||||||
|
if (integration && !integration->initialize(display))
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
return integration.take();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QWaylandXdgShellV6Integration::initialize(QWaylandDisplay *display)
|
bool QWaylandXdgShellV6Integration::initialize(QWaylandDisplay *display)
|
||||||
|
@ -78,19 +78,24 @@ QStringList QWaylandShellIntegrationFactory::keys(const QString &pluginPath)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QWaylandShellIntegration *QWaylandShellIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath)
|
QWaylandShellIntegration *QWaylandShellIntegrationFactory::create(const QString &name, QWaylandDisplay *display, const QStringList &args, const QString &pluginPath)
|
||||||
{
|
{
|
||||||
#if QT_CONFIG(library)
|
#if QT_CONFIG(library)
|
||||||
|
QScopedPointer<QWaylandShellIntegration> integration;
|
||||||
|
|
||||||
// Try loading the plugin from platformPluginPath first:
|
// Try loading the plugin from platformPluginPath first:
|
||||||
if (!pluginPath.isEmpty()) {
|
if (!pluginPath.isEmpty()) {
|
||||||
QCoreApplication::addLibraryPath(pluginPath);
|
QCoreApplication::addLibraryPath(pluginPath);
|
||||||
if (QWaylandShellIntegration *ret = qLoadPlugin<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(directLoader(), name, args))
|
integration.reset(qLoadPlugin<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(directLoader(), name, args));
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
if (QWaylandShellIntegration *ret = qLoadPlugin<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(loader(), name, args))
|
if (!integration)
|
||||||
return ret;
|
integration.reset(qLoadPlugin<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(loader(), name, args));
|
||||||
#endif
|
#endif
|
||||||
return nullptr;
|
|
||||||
|
if (integration && !integration->initialize(display))
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
return integration.take();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,10 @@
|
|||||||
// We mean it.
|
// We mean it.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
|
||||||
|
|
||||||
#include <QtWaylandClient/qtwaylandclientglobal.h>
|
#include <QtWaylandClient/qtwaylandclientglobal.h>
|
||||||
|
|
||||||
#include <QtCore/QStringList>
|
#include <QtCore/QStringList>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -64,7 +67,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegrationFactory
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static QStringList keys(const QString &pluginPath = QString());
|
static QStringList keys(const QString &pluginPath = QString());
|
||||||
static QWaylandShellIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString());
|
static QWaylandShellIntegration *create(const QString &name, QWaylandDisplay *display, const QStringList &args = QStringList(), const QString &pluginPath = QString());
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user