Use surface as XdgExporter parent

This commit is contained in:
Ilya Fedin 2021-05-13 08:39:16 +04:00 committed by John Preston
parent f7489592d6
commit 17c514e851

View file

@ -9,7 +9,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/platform/base_platform_info.h" #include "base/platform/base_platform_info.h"
#include <QtCore/QCoreApplication>
#include <connection_thread.h> #include <connection_thread.h>
#include <registry.h> #include <registry.h>
#include <surface.h> #include <surface.h>
@ -92,10 +91,10 @@ WaylandIntegration::Private::Private()
}; };
connect( connect(
QCoreApplication::instance(), _applicationConnection,
&QCoreApplication::aboutToQuit, &ConnectionThread::connectionDied,
this, _xdgExporter.get(),
[=] { _xdgExporter = nullptr; }); &XdgExporter::destroy);
}); });
_connection.initConnection(); _connection.initConnection();
@ -130,7 +129,7 @@ QString WaylandIntegration::nativeHandle(QWindow *window) {
if (const auto surface = Surface::fromWindow(window)) { if (const auto surface = Surface::fromWindow(window)) {
if (const auto exported = exporter->exportTopLevel( if (const auto exported = exporter->exportTopLevel(
surface, surface,
_private->xdgExporter())) { surface)) {
QEventLoop loop; QEventLoop loop;
QObject::connect( QObject::connect(
exported, exported,