mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Send XDG_ACTIVATION_TOKEN to the first instance
This commit is contained in:
parent
d500714242
commit
0921ae283b
1 changed files with 5 additions and 0 deletions
|
@ -274,6 +274,9 @@ void Sandbox::socketConnected() {
|
|||
for (QStringList::const_iterator i = lst.cbegin(), e = lst.cend(); i != e; ++i) {
|
||||
commands += qsl("SEND:") + _escapeTo7bit(*i) + ';';
|
||||
}
|
||||
if (qEnvironmentVariableIsSet("XDG_ACTIVATION_TOKEN")) {
|
||||
commands += qsl("XDG_ACTIVATION_TOKEN:") + _escapeTo7bit(qEnvironmentVariable("XDG_ACTIVATION_TOKEN")) + ';';
|
||||
}
|
||||
if (!cStartUrl().isEmpty()) {
|
||||
commands += qsl("OPEN:") + _escapeTo7bit(cStartUrl()) + ';';
|
||||
} else if (cQuit()) {
|
||||
|
@ -438,6 +441,8 @@ void Sandbox::readClients() {
|
|||
if (cSendPaths().isEmpty()) {
|
||||
toSend.append(_escapeFrom7bit(cmds.mid(from + 5, to - from - 5)));
|
||||
}
|
||||
} else if (cmd.startsWith(qsl("XDG_ACTIVATION_TOKEN:"))) {
|
||||
qputenv("XDG_ACTIVATION_TOKEN", _escapeFrom7bit(cmds.mid(from + 21, to - from - 21)).toUtf8());
|
||||
} else if (cmd.startsWith(qsl("OPEN:"))) {
|
||||
startUrl = _escapeFrom7bit(cmds.mid(from + 5, to - from - 5)).mid(0, 8192);
|
||||
auto activateRequired = StartUrlRequiresActivate(startUrl);
|
||||
|
|
Loading…
Add table
Reference in a new issue