mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Make use of the new window-less base::Platform::XDP::ParentWindowID
This commit is contained in:
parent
4755be4ace
commit
396635fa1d
3 changed files with 4 additions and 31 deletions
|
@ -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 <fcntl.h>
|
||||
|
@ -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<uint>());
|
||||
|
||||
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<Glib::ustring, Glib::VariantBase>{
|
||||
{
|
||||
|
|
|
@ -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<uint>());
|
||||
|
||||
|
@ -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);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 0919789bf555c651e32bdbcabc397dbacb6a2545
|
||||
Subproject commit 35beda8406844808a27deec9ef718c3f2a345a05
|
Loading…
Add table
Reference in a new issue