diff --git a/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp b/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp index 55ebd4dca..dab8fa498 100644 --- a/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp @@ -14,9 +14,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include -#include +#include #include +using namespace QNativeInterface; +using namespace QNativeInterface::Private; + namespace Platform { namespace internal { namespace { @@ -101,14 +104,12 @@ org_kde_plasma_surface *WaylandIntegration::Private::plasmaSurface( return nullptr; } - const auto native = QGuiApplication::platformNativeInterface(); + const auto native = window->nativeInterface(); if (!native) { return nullptr; } - const auto surface = reinterpret_cast( - native->nativeResourceForWindow(QByteArray("surface"), window)); - + const auto surface = native->surface(); if (!surface) { return nullptr; } @@ -126,8 +127,8 @@ org_kde_plasma_surface *WaylandIntegration::Private::plasmaSurface( plasmaSurfaces.emplace(surface, result); base::qt_signal_producer( - window, - &QObject::destroyed + native, + &QWaylandWindow::surfaceDestroyed ) | rpl::start_with_next([=] { auto it = plasmaSurfaces.find(surface); if (it != plasmaSurfaces.cend()) { @@ -140,14 +141,12 @@ org_kde_plasma_surface *WaylandIntegration::Private::plasmaSurface( WaylandIntegration::WaylandIntegration() : _private(std::make_unique()) { - const auto native = QGuiApplication::platformNativeInterface(); + const auto native = qApp->nativeInterface(); if (!native) { return; } - const auto display = reinterpret_cast( - native->nativeResourceForIntegration(QByteArray("wl_display"))); - + const auto display = native->display(); if (!display) { return; } @@ -159,7 +158,7 @@ WaylandIntegration::WaylandIntegration() _private.get()); base::qt_signal_producer( - native, + qApp, &QObject::destroyed ) | rpl::start_with_next([=] { // too late for standard destructors, just free diff --git a/Telegram/lib_base b/Telegram/lib_base index 17a19f39d..b032f9442 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit 17a19f39d2a1204a90d74516c28fd27c522ded17 +Subproject commit b032f944298bfa464c9378a5c56826cf13956eae diff --git a/cmake b/cmake index a7d000be7..42f842848 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit a7d000be71db475f034c42687e7905fc8116050f +Subproject commit 42f8428489692f0a4a05bf833478bad7ee8d5989