mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Make use of the new window-less base::Platform::XDP::ParentWindowID
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user