summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-03-16 03:04:44 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-03-16 03:04:45 +0100
commit26fccd2e63ae82d1883077dfb14b7720b3c93ef1 (patch)
treec3964adbebe2f6fced958c8ed839d16148f93cf1 /src
parenteabdc86b3a8bc1c94c917166667c3aed57f049f8 (diff)
parent4cba9d595311ac6040bf93450d1fb09ec0a3d9f4 (diff)
downloadqtwayland-26fccd2e63ae82d1883077dfb14b7720b3c93ef1.tar.gz
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I6d63f7390a3d26ce8c63c8e5de63b673d6831395
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylandabstractdecoration.cpp15
-rw-r--r--src/compositor/compositor_api/qwaylandcompositor.cpp3
-rw-r--r--src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp8
3 files changed, 21 insertions, 5 deletions
diff --git a/src/client/qwaylandabstractdecoration.cpp b/src/client/qwaylandabstractdecoration.cpp
index 0f00b989..87dd6cea 100644
--- a/src/client/qwaylandabstractdecoration.cpp
+++ b/src/client/qwaylandabstractdecoration.cpp
@@ -100,14 +100,19 @@ void QWaylandAbstractDecoration::setWaylandWindow(QWaylandWindow *window)
d->m_wayland_window = window;
}
-// \a size is without margins
+// Creates regions like this on the outside of a rectangle with inner size \a size
+// -----
+// | |
+// -----
+// I.e. the top and bottom extends into the corners
static QRegion marginsRegion(const QSize &size, const QMargins &margins)
{
QRegion r;
- r += QRect(0, 0, size.width(), margins.top()); // top
- r += QRect(0, size.height()+margins.top(), size.width(), margins.bottom()); //bottom
- r += QRect(0, 0, margins.left(), size.height()); //left
- r += QRect(size.width()+margins.left(), 0, margins.right(), size.height()); // right
+ const int widthWithMargins = margins.left() + size.width() + margins.right();
+ r += QRect(0, 0, widthWithMargins, margins.top()); // top
+ r += QRect(0, size.height()+margins.top(), widthWithMargins, margins.bottom()); //bottom
+ r += QRect(0, margins.top(), margins.left(), size.height()); //left
+ r += QRect(size.width()+margins.left(), margins.top(), margins.right(), size.height()); // right
return r;
}
diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp
index 173b50ce..a0d69c52 100644
--- a/src/compositor/compositor_api/qwaylandcompositor.cpp
+++ b/src/compositor/compositor_api/qwaylandcompositor.cpp
@@ -243,6 +243,9 @@ QWaylandCompositorPrivate::~QWaylandCompositorPrivate()
delete data_device_manager;
#endif
+ // Some client buffer integrations need to clean up before the destroying the wl_display
+ client_buffer_integration.reset();
+
wl_display_destroy(display);
}
diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
index 2cadf850..88dab2ab 100644
--- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
@@ -186,6 +186,7 @@ public:
EGLDisplay egl_display = EGL_NO_DISPLAY;
bool valid = false;
bool display_bound = false;
+ ::wl_display *wlDisplay = nullptr;
QOffscreenSurface *offscreenSurface = nullptr;
QOpenGLContext *localContext = nullptr;
QVector<QOpenGLTexture *> orphanedTextures;
@@ -394,6 +395,12 @@ WaylandEglClientBufferIntegration::WaylandEglClientBufferIntegration()
WaylandEglClientBufferIntegration::~WaylandEglClientBufferIntegration()
{
WaylandEglClientBufferIntegrationPrivate::shuttingDown = true;
+ Q_D(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";
+ }
}
void WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *display)
@@ -450,6 +457,7 @@ void WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *di
qWarning("QtCompositor: Could not bind Wayland display. Ignoring.");
}
}
+ d->wlDisplay = display;
}
d->funcs = new QEGLStreamConvenience;