mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-26 19:14:02 +02:00
Set parent window ID for portal autostart dialog
This commit is contained in:
parent
acaf8e4931
commit
3a45957ceb
1 changed files with 14 additions and 1 deletions
|
@ -20,6 +20,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "storage/localstorage.h"
|
#include "storage/localstorage.h"
|
||||||
#include "core/crash_reports.h"
|
#include "core/crash_reports.h"
|
||||||
#include "core/update_checker.h"
|
#include "core/update_checker.h"
|
||||||
|
#include "window/window_controller.h"
|
||||||
|
#include "core/application.h"
|
||||||
|
|
||||||
#include <QtWidgets/QApplication>
|
#include <QtWidgets/QApplication>
|
||||||
#include <QtWidgets/QDesktopWidget>
|
#include <QtWidgets/QDesktopWidget>
|
||||||
|
@ -108,8 +110,19 @@ void PortalAutostart(bool autostart, bool silent = false) {
|
||||||
qsl("org.freedesktop.portal.Background"),
|
qsl("org.freedesktop.portal.Background"),
|
||||||
qsl("RequestBackground"));
|
qsl("RequestBackground"));
|
||||||
|
|
||||||
|
const auto parentWindowId = [&] {
|
||||||
|
if (const auto activeWindow = Core::App().activeWindow()) {
|
||||||
|
if (!IsWayland()) {
|
||||||
|
return qsl("x11:%1").arg(QString::number(
|
||||||
|
activeWindow->widget().get()->windowHandle()->winId(),
|
||||||
|
16));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return QString();
|
||||||
|
}();
|
||||||
|
|
||||||
message.setArguments({
|
message.setArguments({
|
||||||
QString(),
|
parentWindowId,
|
||||||
options
|
options
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue