diff --git a/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp b/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp index 9efcb0b68..a425ff59f 100644 --- a/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp @@ -10,8 +10,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/platform/base_platform_info.h" #include "base/platform/linux/base_linux_xdp_utilities.h" #include "base/platform/linux/base_linux_wayland_integration.h" -#include "core/application.h" -#include "window/window_controller.h" #include "base/random.h" #include @@ -60,26 +58,13 @@ bool ShowXDPOpenWithDialog(const QString &filepath) { const auto fdGuard = gsl::finally([&] { ::close(fd); }); - const auto parentWindowId = [&]() -> Glib::ustring { - const auto activeWindow = Core::App().activeWindow(); - if (!activeWindow) { - return {}; - } - - return base::Platform::XDP::ParentWindowID( - activeWindow->widget()->windowHandle()); - }(); - const auto handleToken = Glib::ustring("tdesktop") + std::to_string(base::RandomValue()); const auto activationToken = []() -> Glib::ustring { using base::Platform::WaylandIntegration; if (const auto integration = WaylandIntegration::Instance()) { - if (const auto token = integration->activationToken() - ; !token.isNull()) { - return token.toStdString(); - } + return integration->activationToken().toStdString(); } return {}; }(); @@ -124,7 +109,7 @@ bool ShowXDPOpenWithDialog(const QString &filepath) { kXDPOpenURIInterface, "OpenFile", Glib::create_variant(std::tuple{ - parentWindowId, + base::Platform::XDP::ParentWindowID(), Glib::DBusHandle(), std::map{ { diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 620b146e2..a4885388d 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -17,10 +17,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "mainwindow.h" #include "storage/localstorage.h" #include "core/launcher.h" -#include "core/application.h" #include "core/core_settings.h" #include "core/update_checker.h" -#include "window/window_controller.h" #include "webview/platform/linux/webview_linux_webkitgtk.h" #ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION @@ -65,16 +63,6 @@ bool PortalAutostart(bool start, bool silent) { const auto connection = Gio::DBus::Connection::get_sync( Gio::DBus::BusType::SESSION); - const auto parentWindowId = [&]() -> Glib::ustring { - const auto activeWindow = Core::App().activeWindow(); - if (!activeWindow) { - return {}; - } - - return base::Platform::XDP::ParentWindowID( - activeWindow->widget()->windowHandle()); - }(); - const auto handleToken = Glib::ustring("tdesktop") + std::to_string(base::RandomValue()); @@ -152,7 +140,7 @@ bool PortalAutostart(bool start, bool silent) { "org.freedesktop.portal.Background", "RequestBackground", Glib::create_variant(std::tuple{ - parentWindowId, + base::Platform::XDP::ParentWindowID(), options, }), base::Platform::XDP::kService); diff --git a/Telegram/lib_base b/Telegram/lib_base index 0919789bf..35beda840 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit 0919789bf555c651e32bdbcabc397dbacb6a2545 +Subproject commit 35beda8406844808a27deec9ef718c3f2a345a05