summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-10-31 12:37:35 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2019-10-31 12:37:35 +0100
commit8d1fedd6781babaf130486e5c7192b0ebc9fb039 (patch)
tree20ea97a9cc518de8254820bf64a2e3941628dd17 /src
parent3c5a3654c1f68cd7ee7e801ab098510ebc6a9071 (diff)
parentd4ac2c9915fed87193cd2cf7ac438a9fa8edc126 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Diffstat (limited to 'src')
-rw-r--r--src/compositor/compositor_api/qwaylandcompositor.cpp21
-rw-r--r--src/compositor/compositor_api/qwaylandsurface.cpp3
-rw-r--r--src/compositor/extensions/qwaylandwlshell.cpp3
-rw-r--r--src/compositor/hardware_integration/qwlserverbufferintegration.cpp3
-rw-r--r--src/compositor/hardware_integration/qwlserverbufferintegration_p.h2
-rw-r--r--src/hardwareintegration/compositor/dmabuf-server/dmabufserverbufferintegration.cpp15
-rw-r--r--src/hardwareintegration/compositor/dmabuf-server/dmabufserverbufferintegration.h2
-rw-r--r--src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp15
-rw-r--r--src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h2
-rw-r--r--src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp17
-rw-r--r--src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.h2
-rw-r--r--src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.cpp3
-rw-r--r--src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.h2
-rw-r--r--src/hardwareintegration/compositor/vulkan-server/vulkanserverbufferintegration.cpp3
-rw-r--r--src/hardwareintegration/compositor/vulkan-server/vulkanserverbufferintegration.h2
-rw-r--r--src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp47
-rw-r--r--src/imports/compositor/WaylandCursorItem.qml2
-rw-r--r--src/imports/compositor/plugins.qmltypes49
18 files changed, 135 insertions, 58 deletions
diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp
index ae0d793d3..b75ead7bd 100644
--- a/src/compositor/compositor_api/qwaylandcompositor.cpp
+++ b/src/compositor/compositor_api/qwaylandcompositor.cpp
@@ -365,9 +365,6 @@ void QWaylandCompositorPrivate::initializeHardwareIntegration()
loadClientBufferIntegration();
loadServerBufferIntegration();
-
- if (server_buffer_integration)
- server_buffer_integration->initializeHardware(q);
#endif
}
@@ -429,6 +426,7 @@ void QWaylandCompositorPrivate::loadClientBufferIntegration()
void QWaylandCompositorPrivate::loadServerBufferIntegration()
{
#if QT_CONFIG(opengl)
+ Q_Q(QWaylandCompositor);
QStringList keys = QtWayland::ServerBufferIntegrationFactory::keys();
QString targetKey;
QByteArray serverBufferIntegration = qgetenv("QT_WAYLAND_SERVER_BUFFER_INTEGRATION");
@@ -437,9 +435,22 @@ void QWaylandCompositorPrivate::loadServerBufferIntegration()
}
if (!targetKey.isEmpty()) {
server_buffer_integration.reset(QtWayland::ServerBufferIntegrationFactory::create(targetKey, QStringList()));
- if (hw_integration)
- hw_integration->setServerBufferIntegration(targetKey);
+ if (server_buffer_integration) {
+ qCDebug(qLcWaylandCompositorHardwareIntegration)
+ << "Loaded server buffer integration:" << targetKey;
+ if (!server_buffer_integration->initializeHardware(q)) {
+ qCWarning(qLcWaylandCompositorHardwareIntegration)
+ << "Failed to initialize hardware for server buffer integration:" << targetKey;
+ server_buffer_integration.reset();
+ }
+ } else {
+ qCWarning(qLcWaylandCompositorHardwareIntegration)
+ << "Failed to load server buffer integration:" << targetKey;
+ }
}
+
+ if (server_buffer_integration && hw_integration)
+ hw_integration->setServerBufferIntegration(targetKey);
#endif
}
diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp
index 22bf8fe77..41a678128 100644
--- a/src/compositor/compositor_api/qwaylandsurface.cpp
+++ b/src/compositor/compositor_api/qwaylandsurface.cpp
@@ -382,7 +382,8 @@ QWaylandSurface::QWaylandSurface(QWaylandSurfacePrivate &dptr)
QWaylandSurface::~QWaylandSurface()
{
Q_D(QWaylandSurface);
- QWaylandCompositorPrivate::get(d->compositor)->unregisterSurface(this);
+ if (d->compositor)
+ QWaylandCompositorPrivate::get(d->compositor)->unregisterSurface(this);
d->notifyViewsAboutDestruction();
}
diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp
index aa8a93aff..6eb1c06e4 100644
--- a/src/compositor/extensions/qwaylandwlshell.cpp
+++ b/src/compositor/extensions/qwaylandwlshell.cpp
@@ -457,7 +457,8 @@ QWaylandWlShellSurface::QWaylandWlShellSurface(QWaylandWlShell *shell, QWaylandS
QWaylandWlShellSurface::~QWaylandWlShellSurface()
{
Q_D(QWaylandWlShellSurface);
- QWaylandWlShellPrivate::get(d->m_shell)->unregisterShellSurface(this);
+ if (d->m_shell)
+ QWaylandWlShellPrivate::get(d->m_shell)->unregisterShellSurface(this);
}
/*!
diff --git a/src/compositor/hardware_integration/qwlserverbufferintegration.cpp b/src/compositor/hardware_integration/qwlserverbufferintegration.cpp
index 423376665..e8c1a21fd 100644
--- a/src/compositor/hardware_integration/qwlserverbufferintegration.cpp
+++ b/src/compositor/hardware_integration/qwlserverbufferintegration.cpp
@@ -58,9 +58,10 @@ ServerBufferIntegration::ServerBufferIntegration()
ServerBufferIntegration::~ServerBufferIntegration()
{ }
-void ServerBufferIntegration::initializeHardware(QWaylandCompositor *compositor)
+bool ServerBufferIntegration::initializeHardware(QWaylandCompositor *compositor)
{
Q_UNUSED(compositor);
+ return true;
}
}
diff --git a/src/compositor/hardware_integration/qwlserverbufferintegration_p.h b/src/compositor/hardware_integration/qwlserverbufferintegration_p.h
index bd4911e4e..96efd9e46 100644
--- a/src/compositor/hardware_integration/qwlserverbufferintegration_p.h
+++ b/src/compositor/hardware_integration/qwlserverbufferintegration_p.h
@@ -93,7 +93,7 @@ public:
ServerBufferIntegration();
virtual ~ServerBufferIntegration();
- virtual void initializeHardware(QWaylandCompositor *);
+ virtual bool initializeHardware(QWaylandCompositor *);
virtual bool supportsFormat(ServerBuffer::Format format) const = 0;
virtual ServerBuffer *createServerBufferFromImage(const QImage &qimage, ServerBuffer::Format format) = 0;
diff --git a/src/hardwareintegration/compositor/dmabuf-server/dmabufserverbufferintegration.cpp b/src/hardwareintegration/compositor/dmabuf-server/dmabufserverbufferintegration.cpp
index b2c78cbba..c72cf2d0a 100644
--- a/src/hardwareintegration/compositor/dmabuf-server/dmabufserverbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/dmabuf-server/dmabufserverbufferintegration.cpp
@@ -137,48 +137,49 @@ DmaBufServerBufferIntegration::~DmaBufServerBufferIntegration()
{
}
-void DmaBufServerBufferIntegration::initializeHardware(QWaylandCompositor *compositor)
+bool DmaBufServerBufferIntegration::initializeHardware(QWaylandCompositor *compositor)
{
Q_ASSERT(QGuiApplication::platformNativeInterface());
m_egl_display = static_cast<EGLDisplay>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("egldisplay"));
if (!m_egl_display) {
qCWarning(qLcWaylandCompositorHardwareIntegration) << "Cannot initialize dmabuf server buffer integration. Missing egl display from platform plugin";
- return;
+ return false;
}
const char *extensionString = eglQueryString(m_egl_display, EGL_EXTENSIONS);
if (!extensionString || !strstr(extensionString, "EGL_KHR_image")) {
qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize dmabuf server buffer integration. There is no EGL_KHR_image extension.";
- return;
+ return false;
}
m_egl_create_image = reinterpret_cast<PFNEGLCREATEIMAGEKHRPROC>(eglGetProcAddress("eglCreateImageKHR"));
m_egl_destroy_image = reinterpret_cast<PFNEGLDESTROYIMAGEKHRPROC>(eglGetProcAddress("eglDestroyImageKHR"));
if (!m_egl_create_image || !m_egl_destroy_image) {
qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize dmabuf server buffer integration. Could not resolve eglCreateImageKHR or eglDestroyImageKHR";
- return;
+ return false;
}
m_gl_egl_image_target_texture_2d = reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>(eglGetProcAddress("glEGLImageTargetTexture2DOES"));
if (!m_gl_egl_image_target_texture_2d) {
qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize dmabuf server buffer integration. Could not find glEGLImageTargetTexture2DOES.";
- return;
+ return false;
}
m_egl_export_dmabuf_image_query = reinterpret_cast<PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC>(eglGetProcAddress("eglExportDMABUFImageQueryMESA"));
if (!m_egl_export_dmabuf_image_query) {
qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize dmabuf server buffer integration. Could not find eglExportDMABUFImageQueryMESA.";
- return;
+ return false;
}
m_egl_export_dmabuf_image = reinterpret_cast<PFNEGLEXPORTDMABUFIMAGEMESAPROC>(eglGetProcAddress("eglExportDMABUFImageMESA"));
if (!m_egl_export_dmabuf_image) {
qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize dmabuf server buffer integration. Could not find eglExportDMABUFImageMESA.";
- return;
+ return false;
}
QtWaylandServer::qt_dmabuf_server_buffer::init(compositor->display(), 1);
+ return true;
}
bool DmaBufServerBufferIntegration::supportsFormat(QtWayland::ServerBuffer::Format format) const
diff --git a/src/hardwareintegration/compositor/dmabuf-server/dmabufserverbufferintegration.h b/src/hardwareintegration/compositor/dmabuf-server/dmabufserverbufferintegration.h
index 23f50142b..4e9f8c741 100644
--- a/src/hardwareintegration/compositor/dmabuf-server/dmabufserverbufferintegration.h
+++ b/src/hardwareintegration/compositor/dmabuf-server/dmabufserverbufferintegration.h
@@ -98,7 +98,7 @@ public:
DmaBufServerBufferIntegration();
~DmaBufServerBufferIntegration() override;
- void initializeHardware(QWaylandCompositor *) override;
+ bool initializeHardware(QWaylandCompositor *) override;
bool supportsFormat(QtWayland::ServerBuffer::Format format) const override;
QtWayland::ServerBuffer *createServerBufferFromImage(const QImage &qimage, QtWayland::ServerBuffer::Format format) override;
diff --git a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp
index 4f483f24f..03b389eff 100644
--- a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp
@@ -124,47 +124,48 @@ DrmEglServerBufferIntegration::~DrmEglServerBufferIntegration()
{
}
-void DrmEglServerBufferIntegration::initializeHardware(QWaylandCompositor *compositor)
+bool DrmEglServerBufferIntegration::initializeHardware(QWaylandCompositor *compositor)
{
Q_ASSERT(QGuiApplication::platformNativeInterface());
m_egl_display = static_cast<EGLDisplay>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("egldisplay"));
if (!m_egl_display) {
qWarning("Can't initialize drm egl server buffer integration. Missing egl display from platform plugin");
- return;
+ return false;
}
const char *extensionString = eglQueryString(m_egl_display, EGL_EXTENSIONS);
if (!extensionString || !strstr(extensionString, "EGL_KHR_image")) {
qWarning("Failed to initialize drm egl server buffer integration. There is no EGL_KHR_image extension.\n");
- return;
+ return false;
}
m_egl_create_image = reinterpret_cast<PFNEGLCREATEIMAGEKHRPROC>(eglGetProcAddress("eglCreateImageKHR"));
m_egl_destroy_image = reinterpret_cast<PFNEGLDESTROYIMAGEKHRPROC>(eglGetProcAddress("eglDestroyImageKHR"));
if (!m_egl_create_image || !m_egl_destroy_image) {
qWarning("Failed to initialize drm egl server buffer integration. Could not resolve eglCreateImageKHR or eglDestroyImageKHR");
- return;
+ return false;
}
if (!extensionString || !strstr(extensionString, "EGL_MESA_drm_image")) {
qWarning("Failed to initialize drm egl server buffer integration. There is no EGL_MESA_drm_image extension.\n");
- return;
+ return false;
}
m_egl_create_drm_image = reinterpret_cast<PFNEGLCREATEDRMIMAGEMESAPROC>(eglGetProcAddress("eglCreateDRMImageMESA"));
m_egl_export_drm_image = reinterpret_cast<PFNEGLEXPORTDRMIMAGEMESAPROC>(eglGetProcAddress("eglExportDRMImageMESA"));
if (!m_egl_create_drm_image || !m_egl_export_drm_image) {
qWarning("Failed to initialize drm egl server buffer integration. Could not find eglCreateDRMImageMESA or eglExportDRMImageMESA.\n");
- return;
+ return false;
}
m_gl_egl_image_target_texture_2d = reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>(eglGetProcAddress("glEGLImageTargetTexture2DOES"));
if (!m_gl_egl_image_target_texture_2d) {
qWarning("Failed to initialize drm egl server buffer integration. Could not find glEGLImageTargetTexture2DOES.\n");
- return;
+ return false;
}
QtWaylandServer::qt_drm_egl_server_buffer::init(compositor->display(), 1);
+ return true;
}
bool DrmEglServerBufferIntegration::supportsFormat(QtWayland::ServerBuffer::Format format) const
diff --git a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h
index f932ff0de..eab5f0c56 100644
--- a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h
+++ b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h
@@ -92,7 +92,7 @@ public:
DrmEglServerBufferIntegration();
~DrmEglServerBufferIntegration() override;
- void initializeHardware(QWaylandCompositor *) override;
+ bool initializeHardware(QWaylandCompositor *) override;
bool supportsFormat(QtWayland::ServerBuffer::Format format) const override;
QtWayland::ServerBuffer *createServerBufferFromImage(const QImage &qimage, QtWayland::ServerBuffer::Format format) override;
diff --git a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp
index a47adaf3f..f9ef5635d 100644
--- a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp
@@ -124,51 +124,52 @@ LibHybrisEglServerBufferIntegration::~LibHybrisEglServerBufferIntegration()
{
}
-void LibHybrisEglServerBufferIntegration::initializeHardware(QWaylandCompositor *compositor)
+bool LibHybrisEglServerBufferIntegration::initializeHardware(QWaylandCompositor *compositor)
{
Q_ASSERT(QGuiApplication::platformNativeInterface());
m_egl_display = static_cast<EGLDisplay>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("egldisplay"));
if (!m_egl_display) {
qWarning("Can't initialize libhybris egl server buffer integration. Missing egl display from platform plugin");
- return;
+ return false;
}
m_egl_create_buffer = reinterpret_cast<PFNEGLHYBRISCREATENATIVEBUFFERPROC>(eglGetProcAddress("eglHybrisCreateNativeBuffer"));
if (!m_egl_create_buffer) {
qWarning("Failed to initialize libhybris egl server buffer integration. Could not find eglHybrisCreateNativeBuffer.\n");
- return;
+ return false;
}
m_egl_get_buffer_info = reinterpret_cast<PFNEGLHYBRISGETNATIVEBUFFERINFOPROC>(eglGetProcAddress("eglHybrisGetNativeBufferInfo"));
if (!m_egl_get_buffer_info) {
qWarning("Failed to initialize libhybris egl server buffer integration. Could not find eglHybrisGetNativeBufferInfo.\n");
- return;
+ return false;
}
m_egl_serialize_buffer = reinterpret_cast<PFNEGLHYBRISSERIALIZENATIVEBUFFERPROC>(eglGetProcAddress("eglHybrisSerializeNativeBuffer"));
if (!m_egl_serialize_buffer) {
qWarning("Failed to initialize libhybris egl server buffer integration. Could not find eglHybrisSerializeNativeBuffer.\n");
- return;
+ return false;
}
const char *extensionString = eglQueryString(m_egl_display, EGL_EXTENSIONS);
if (!extensionString || !strstr(extensionString, "EGL_KHR_image")) {
qWarning("Failed to initialize libhybris egl server buffer integration. There is no EGL_KHR_image extension.\n");
- return;
+ return false;
}
m_egl_create_image = reinterpret_cast<PFNEGLCREATEIMAGEKHRPROC>(eglGetProcAddress("eglCreateImageKHR"));
m_egl_destroy_image = reinterpret_cast<PFNEGLDESTROYIMAGEKHRPROC>(eglGetProcAddress("eglDestroyImageKHR"));
if (!m_egl_create_image || !m_egl_destroy_image) {
qWarning("Failed to initialize libhybris egl server buffer integration. Could not resolve eglCreateImageKHR or eglDestroyImageKHR");
- return;
+ return false;
}
m_gl_egl_image_target_texture_2d = reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>(eglGetProcAddress("glEGLImageTargetTexture2DOES"));
if (!m_gl_egl_image_target_texture_2d) {
qWarning("Failed to initialize libhybris egl server buffer integration. Could not find glEGLImageTargetTexture2DOES.\n");
- return;
+ return false;
}
QtWaylandServer::qt_libhybris_egl_server_buffer::init(compositor->display(), 1);
+ return true;
}
bool LibHybrisEglServerBufferIntegration::supportsFormat(QtWayland::ServerBuffer::Format format) const
diff --git a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.h b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.h
index d26cb0ec1..addbb71f5 100644
--- a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.h
+++ b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.h
@@ -95,7 +95,7 @@ public:
LibHybrisEglServerBufferIntegration();
~LibHybrisEglServerBufferIntegration();
- void initializeHardware(QWaylandCompositor *);
+ bool initializeHardware(QWaylandCompositor *);
bool supportsFormat(QtWayland::ServerBuffer::Format format) const override;
QtWayland::ServerBuffer *createServerBufferFromImage(const QImage &qimage, QtWayland::ServerBuffer::Format format) override;
diff --git a/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.cpp b/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.cpp
index 359f39b61..7d7efee36 100644
--- a/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.cpp
@@ -113,11 +113,12 @@ ShmServerBufferIntegration::~ShmServerBufferIntegration()
{
}
-void ShmServerBufferIntegration::initializeHardware(QWaylandCompositor *compositor)
+bool ShmServerBufferIntegration::initializeHardware(QWaylandCompositor *compositor)
{
Q_ASSERT(QGuiApplication::platformNativeInterface());
QtWaylandServer::qt_shm_emulation_server_buffer::init(compositor->display(), 1);
+ return true;
}
bool ShmServerBufferIntegration::supportsFormat(QtWayland::ServerBuffer::Format format) const
diff --git a/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.h b/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.h
index a39ba81cd..95439f080 100644
--- a/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.h
+++ b/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.h
@@ -76,7 +76,7 @@ public:
ShmServerBufferIntegration();
~ShmServerBufferIntegration() override;
- void initializeHardware(QWaylandCompositor *) override;
+ bool initializeHardware(QWaylandCompositor *) override;
bool supportsFormat(QtWayland::ServerBuffer::Format format) const override;
QtWayland::ServerBuffer *createServerBufferFromImage(const QImage &qimage, QtWayland::ServerBuffer::Format format) override;
diff --git a/src/hardwareintegration/compositor/vulkan-server/vulkanserverbufferintegration.cpp b/src/hardwareintegration/compositor/vulkan-server/vulkanserverbufferintegration.cpp
index 79dc62118..602e25f73 100644
--- a/src/hardwareintegration/compositor/vulkan-server/vulkanserverbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/vulkan-server/vulkanserverbufferintegration.cpp
@@ -265,11 +265,12 @@ VulkanServerBufferIntegration::~VulkanServerBufferIntegration()
{
}
-void VulkanServerBufferIntegration::initializeHardware(QWaylandCompositor *compositor)
+bool VulkanServerBufferIntegration::initializeHardware(QWaylandCompositor *compositor)
{
Q_ASSERT(QGuiApplication::platformNativeInterface());
QtWaylandServer::zqt_vulkan_server_buffer_v1::init(compositor->display(), 1);
+ return true;
}
bool VulkanServerBufferIntegration::supportsFormat(QtWayland::ServerBuffer::Format format) const
diff --git a/src/hardwareintegration/compositor/vulkan-server/vulkanserverbufferintegration.h b/src/hardwareintegration/compositor/vulkan-server/vulkanserverbufferintegration.h
index df020f8a6..6e2c51dd4 100644
--- a/src/hardwareintegration/compositor/vulkan-server/vulkanserverbufferintegration.h
+++ b/src/hardwareintegration/compositor/vulkan-server/vulkanserverbufferintegration.h
@@ -86,7 +86,7 @@ public:
VulkanWrapper *vulkanWrapper() const { return m_vulkanWrapper; }
- void initializeHardware(QWaylandCompositor *) override;
+ bool initializeHardware(QWaylandCompositor *) override;
bool supportsFormat(QtWayland::ServerBuffer::Format format) const override;
QtWayland::ServerBuffer *createServerBufferFromImage(const QImage &qimage, QtWayland::ServerBuffer::Format format) override;
diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
index fe35b92cd..dd23f6f9c 100644
--- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
@@ -174,7 +174,6 @@ public:
void deleteOrphanedTextures();
EGLDisplay egl_display = EGL_NO_DISPLAY;
- bool valid = false;
bool display_bound = false;
::wl_display *wlDisplay = nullptr;
QOffscreenSurface *offscreenSurface = nullptr;
@@ -221,7 +220,8 @@ void WaylandEglClientBufferIntegrationPrivate::initEglTexture(WaylandEglClientBu
gl_egl_image_target_texture_2d = reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>(eglGetProcAddress("glEGLImageTargetTexture2DOES"));
if (!gl_egl_image_target_texture_2d) {
- qWarning("QtCompositor: bindTextureToBuffer() failed. Could not find glEGLImageTargetTexture2DOES.");
+ qCWarning(qLcWaylandCompositorHardwareIntegration)
+ << "BindTextureToBuffer() failed. Could not find glEGLImageTargetTexture2DOES.";
return;
}
@@ -266,8 +266,10 @@ void WaylandEglClientBufferIntegrationPrivate::initEglTexture(WaylandEglClientBu
buffer->waylandBufferHandle(),
attribs);
- if (image == EGL_NO_IMAGE_KHR)
- qWarning("failed to create EGL image for plane %d", i);
+ if (image == EGL_NO_IMAGE_KHR) {
+ qCWarning(qLcWaylandCompositorHardwareIntegration)
+ << "Failed to create EGL image for plane" << i;
+ }
state.egl_images << image;
state.textures[i] = nullptr;
@@ -316,13 +318,14 @@ bool WaylandEglClientBufferIntegrationPrivate::initEglStream(WaylandEglClientBuf
}
if (state.egl_stream == EGL_NO_STREAM_KHR) {
- qWarning("%s:%d: eglCreateStreamFromFileDescriptorKHR failed: 0x%x", Q_FUNC_INFO, __LINE__, eglGetError());
+ qCWarning(qLcWaylandCompositorHardwareIntegration, "%s:%d: eglCreateStreamFromFileDescriptorKHR failed: 0x%x", Q_FUNC_INFO, __LINE__, eglGetError());
return false;
}
state.eglMode = BufferState::ModeEGLStream;
if (!QOpenGLContext::currentContext()) {
- qWarning("EglClientBufferIntegration: creating texture with no current context");
+ qCWarning(qLcWaylandCompositorHardwareIntegration)
+ << "EglClientBufferIntegration: creating texture with no current context";
return false;
}
@@ -335,7 +338,7 @@ bool WaylandEglClientBufferIntegrationPrivate::initEglStream(WaylandEglClientBuf
auto newStream = funcs->stream_consumer_gltexture(egl_display, state.egl_stream);
if (!newStream) {
EGLint code = eglGetError();
- qWarning() << "Could not initialize EGLStream:" << egl_error_string(code) << hex << (long)code;
+ qCWarning(qLcWaylandCompositorHardwareIntegration) << "Could not initialize EGLStream:" << egl_error_string(code) << hex << (long)code;
funcs->destroy_stream(egl_display, state.egl_stream);
state.egl_stream = EGL_NO_STREAM_KHR;
return false;
@@ -363,7 +366,9 @@ void WaylandEglClientBufferIntegrationPrivate::handleEglstreamTexture(WaylandEgl
if (stream_state == EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR) {
if (funcs->stream_consumer_acquire(egl_display, state.egl_stream) != EGL_TRUE)
- qWarning("%s:%d: eglStreamConsumerAcquireKHR failed: 0x%x", Q_FUNC_INFO, __LINE__, eglGetError());
+ qCWarning(qLcWaylandCompositorHardwareIntegration,
+ "%s:%d: eglStreamConsumerAcquireKHR failed: 0x%x", Q_FUNC_INFO, __LINE__,
+ eglGetError());
}
if (usingLocalContext)
@@ -389,7 +394,7 @@ WaylandEglClientBufferIntegration::~WaylandEglClientBufferIntegration()
if (d->egl_unbind_wayland_display && d->display_bound) {
Q_ASSERT(d->wlDisplay);
if (!d->egl_unbind_wayland_display(d->egl_display, d->wlDisplay))
- qWarning() << "Qt Wayland Compositor: eglUnbindWaylandDisplayWL failed";
+ qCWarning(qLcWaylandCompositorHardwareIntegration) << "eglUnbindWaylandDisplayWL failed";
}
}
@@ -401,39 +406,45 @@ bool WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *di
QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
if (!nativeInterface) {
- qWarning("QtCompositor: Failed to initialize EGL display. No native platform interface available.");
+ qCWarning(qLcWaylandCompositorHardwareIntegration)
+ << "Failed to initialize EGL display. No native platform interface available.";
return false;
}
d->egl_display = nativeInterface->nativeResourceForIntegration("EglDisplay");
if (!d->egl_display) {
- qWarning("QtCompositor: Failed to initialize EGL display. Could not get EglDisplay for window.");
+ qCWarning(qLcWaylandCompositorHardwareIntegration)
+ << "Failed to initialize EGL display. Could not get EglDisplay for window.";
return false;
}
const char *extensionString = eglQueryString(d->egl_display, EGL_EXTENSIONS);
if ((!extensionString || !strstr(extensionString, "EGL_WL_bind_wayland_display")) && !ignoreBindDisplay) {
- qWarning("QtCompositor: Failed to initialize EGL display. There is no EGL_WL_bind_wayland_display extension.");
+ qCWarning(qLcWaylandCompositorHardwareIntegration)
+ << "Failed to initialize EGL display. There is no EGL_WL_bind_wayland_display extension.";
return false;
}
d->egl_bind_wayland_display = reinterpret_cast<PFNEGLBINDWAYLANDDISPLAYWL>(eglGetProcAddress("eglBindWaylandDisplayWL"));
d->egl_unbind_wayland_display = reinterpret_cast<PFNEGLUNBINDWAYLANDDISPLAYWL>(eglGetProcAddress("eglUnbindWaylandDisplayWL"));
if ((!d->egl_bind_wayland_display || !d->egl_unbind_wayland_display) && !ignoreBindDisplay) {
- qWarning("QtCompositor: Failed to initialize EGL display. Could not find eglBindWaylandDisplayWL and eglUnbindWaylandDisplayWL.");
+ qCWarning(qLcWaylandCompositorHardwareIntegration)
+ << "Failed to initialize EGL display. Could not find eglBindWaylandDisplayWL and eglUnbindWaylandDisplayWL.";
return false;
}
d->egl_query_wayland_buffer = reinterpret_cast<PFNEGLQUERYWAYLANDBUFFERWL_compat>(eglGetProcAddress("eglQueryWaylandBufferWL"));
if (!d->egl_query_wayland_buffer) {
- qWarning("QtCompositor: Failed to initialize EGL display. Could not find eglQueryWaylandBufferWL.");
+ qCWarning(qLcWaylandCompositorHardwareIntegration)
+ << "Failed to initialize EGL display. Could not find eglQueryWaylandBufferWL.";
return false;
}
d->egl_create_image = reinterpret_cast<PFNEGLCREATEIMAGEKHRPROC>(eglGetProcAddress("eglCreateImageKHR"));
d->egl_destroy_image = reinterpret_cast<PFNEGLDESTROYIMAGEKHRPROC>(eglGetProcAddress("eglDestroyImageKHR"));
if (!d->egl_create_image || !d->egl_destroy_image) {
- qWarning("QtCompositor: Failed to initialize EGL display. Could not find eglCreateImageKHR and eglDestroyImageKHR.");
+ qCWarning(qLcWaylandCompositorHardwareIntegration)
+ << "Failed to initialize EGL display. Could not find eglCreateImageKHR and eglDestroyImageKHR.";
return false;
}
@@ -441,10 +452,11 @@ bool WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *di
d->display_bound = d->egl_bind_wayland_display(d->egl_display, display);
if (!d->display_bound) {
if (!ignoreBindDisplay) {
- qWarning("QtCompositor: Failed to initialize EGL display. Could not bind Wayland display.");
+ qCWarning(qLcWaylandCompositorHardwareIntegration)
+ << "Failed to initialize EGL display. Could not bind Wayland display.";
return false;
} else {
- qWarning("QtCompositor: Could not bind Wayland display. Ignoring.");
+ qCWarning(qLcWaylandCompositorHardwareIntegration) << "Could not bind Wayland display. Ignoring.";
}
}
d->wlDisplay = display;
@@ -453,7 +465,6 @@ bool WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *di
d->funcs = new QEGLStreamConvenience;
d->funcs->initialize(d->egl_display);
- d->valid = true;
return true;
}
diff --git a/src/imports/compositor/WaylandCursorItem.qml b/src/imports/compositor/WaylandCursorItem.qml
index 8feb3e4f0..bb0a840a4 100644
--- a/src/imports/compositor/WaylandCursorItem.qml
+++ b/src/imports/compositor/WaylandCursorItem.qml
@@ -63,7 +63,7 @@ WaylandQuickItem {
x: cursorItem.hotspotX + offset.x
y: cursorItem.hotspotY + offset.y
z: -1
- surface: cursorItem.seat.drag.icon
+ surface: cursorItem.seat ? cursorItem.seat.drag.icon : null
Connections {
target: dragIcon.surface
diff --git a/src/imports/compositor/plugins.qmltypes b/src/imports/compositor/plugins.qmltypes
index 07a306e57..d05cf3c13 100644
--- a/src/imports/compositor/plugins.qmltypes
+++ b/src/imports/compositor/plugins.qmltypes
@@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -defaultplatform QtWayland.Compositor 1.13'
+// 'qmlplugindump -nonrelocatable QtWayland.Compositor 1.14'
Module {
dependencies: ["QtQuick 2.0", "QtQuick.Window 2.11"]
@@ -120,6 +120,15 @@ Module {
Method { name: "drop" }
Method { name: "cancelDrag" }
}
+ Component { name: "QWaylandIdleInhibitManagerV1"; prototype: "QWaylandCompositorExtension" }
+ Component {
+ name: "QWaylandIdleInhibitManagerV1QuickExtension"
+ defaultProperty: "data"
+ prototype: "QWaylandIdleInhibitManagerV1"
+ exports: ["QtWayland.Compositor/IdleInhibitManagerV1 1.14"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
+ }
Component {
name: "QWaylandIviApplication"
prototype: "QWaylandCompositorExtension"
@@ -376,6 +385,13 @@ Module {
Property { name: "clientRenderingEnabled"; type: "bool" }
}
Component {
+ name: "QWaylandQuickXdgOutputV1"
+ defaultProperty: "data"
+ prototype: "QWaylandXdgOutputV1"
+ exports: ["QtWayland.Compositor/XdgOutputV1 1.14"]
+ exportMetaObjectRevisions: [0]
+ }
+ Component {
name: "QWaylandResource"
exports: ["QtWayland.Compositor/WaylandResource 1.0"]
isCreatable: false
@@ -495,6 +511,7 @@ Module {
Property { name: "origin"; type: "QWaylandSurface::Origin"; isReadonly: true }
Property { name: "hasContent"; type: "bool"; isReadonly: true }
Property { name: "cursorSurface"; type: "bool" }
+ Property { name: "inhibitsIdle"; revision: 14; type: "bool"; isReadonly: true }
Signal {
name: "damaged"
Parameter { name: "rect"; type: "QRegion" }
@@ -532,6 +549,7 @@ Module {
name: "dragStarted"
Parameter { name: "drag"; type: "QWaylandDrag"; isPointer: true }
}
+ Signal { name: "inhibitsIdleChanged"; revision: 14 }
Signal {
name: "configure"
Parameter { name: "hasBuffer"; type: "bool" }
@@ -691,6 +709,33 @@ Module {
exportMetaObjectRevisions: [0]
Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
}
+ Component { name: "QWaylandXdgOutputManagerV1"; prototype: "QWaylandCompositorExtension" }
+ Component {
+ name: "QWaylandXdgOutputManagerV1QuickExtension"
+ defaultProperty: "data"
+ prototype: "QWaylandXdgOutputManagerV1"
+ exports: ["QtWayland.Compositor/XdgOutputManagerV1 1.14"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
+ }
+ Component {
+ name: "QWaylandXdgOutputV1"
+ defaultProperty: "data"
+ prototype: "QObject"
+ Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
+ Property {
+ name: "manager"
+ type: "QWaylandXdgOutputManagerV1"
+ isReadonly: true
+ isPointer: true
+ }
+ Property { name: "output"; type: "QWaylandOutput"; isReadonly: true; isPointer: true }
+ Property { name: "name"; type: "string" }
+ Property { name: "description"; type: "string" }
+ Property { name: "logicalPosition"; type: "QPoint" }
+ Property { name: "logicalSize"; type: "QSize" }
+ Property { name: "logicalGeometry"; type: "QRect"; isReadonly: true }
+ }
Component {
name: "QWaylandXdgPopup"
prototype: "QObject"
@@ -719,6 +764,7 @@ Module {
type: "uint"
Parameter { name: "geometry"; type: "QRect" }
}
+ Method { name: "sendPopupDone"; revision: 14 }
}
Component {
name: "QWaylandXdgPopupV5"
@@ -769,6 +815,7 @@ Module {
type: "uint"
Parameter { name: "geometry"; type: "QRect" }
}
+ Method { name: "sendPopupDone"; revision: 14 }
}
Component {
name: "QWaylandXdgShell"