From 0551a39ab62fd667d13f4b3a93e7fff8aeca1b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 24 Mar 2016 13:45:58 +0100 Subject: [PATCH] [server] Apply position change directly for desync sub-surfaces Summary: This is a workaround for https://bugreports.qt.io/browse/QTBUG-52118 It should take effect whenever the parent surface's state is applied, but QtWayland never commits the parent surface. Thus the position is always wrong. Having a workaround for that in our server code is not good, but better than completely broken applications such as Systemsettings. Reviewers: #plasma Subscribers: plasma-devel Projects: #plasma Differential Revision: https://phabricator.kde.org/D1212 --- src/wayland/subcompositor_interface.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wayland/subcompositor_interface.cpp b/src/wayland/subcompositor_interface.cpp index a701e1687d..23fec333f0 100644 --- a/src/wayland/subcompositor_interface.cpp +++ b/src/wayland/subcompositor_interface.cpp @@ -219,6 +219,14 @@ void SubSurfaceInterface::Private::setPositionCallback(wl_client *client, wl_res void SubSurfaceInterface::Private::setPosition(const QPoint &p) { + Q_Q(SubSurfaceInterface); + if (!q->isSynchronized()) { + // workaround for https://bugreports.qt.io/browse/QTBUG-52118 + // apply directly as Qt doesn't commit the parent surface + pos = p; + emit q->positionChanged(pos); + return; + } if (scheduledPos == p) { return; }