From 988ce28943dbdbda2d418ee777a0c2259cb50343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 28 May 2015 08:27:34 +0200 Subject: [PATCH] [wayland] Ensure size is updated before marking window as ready for painting Fixes regression introduced with 90a6814: we may not queue a signal taking a pointer to a ShellClient as the ShellClient might be destroyed before the queued signal is delivered. The idea for the queued signal was to ensure that the size is set when windowShown is emitted - this can also be achieved by first updating the size. --- shell_client.cpp | 2 +- wayland_server.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shell_client.cpp b/shell_client.cpp index f3faa135e..d5d7a1f41 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -151,11 +151,11 @@ void ShellClient::setOpacity(double opacity) void ShellClient::addDamage(const QRegion &damage) { - setReadyForPainting(); if (m_shellSurface->surface()->buffer()->size().isValid()) { m_clientSize = m_shellSurface->surface()->buffer()->size(); setGeometry(QRect(geom.topLeft(), m_clientSize)); } + setReadyForPainting(); Toplevel::addDamage(damage); } diff --git a/wayland_server.cpp b/wayland_server.cpp index 9248805f5..05a470f5a 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -127,7 +127,7 @@ void WaylandServer::init(const QByteArray &socketName) connect(client, &ShellClient::windowShown, this, [this, client] { emit shellClientAdded(client); - }, Qt::QueuedConnection + } ); } } -- GitLab