Send XDG_ACTIVATION_TOKEN to the first instance
This commit is contained in:
parent
d500714242
commit
0921ae283b
|
@ -274,6 +274,9 @@ void Sandbox::socketConnected() {
|
||||||
for (QStringList::const_iterator i = lst.cbegin(), e = lst.cend(); i != e; ++i) {
|
for (QStringList::const_iterator i = lst.cbegin(), e = lst.cend(); i != e; ++i) {
|
||||||
commands += qsl("SEND:") + _escapeTo7bit(*i) + ';';
|
commands += qsl("SEND:") + _escapeTo7bit(*i) + ';';
|
||||||
}
|
}
|
||||||
|
if (qEnvironmentVariableIsSet("XDG_ACTIVATION_TOKEN")) {
|
||||||
|
commands += qsl("XDG_ACTIVATION_TOKEN:") + _escapeTo7bit(qEnvironmentVariable("XDG_ACTIVATION_TOKEN")) + ';';
|
||||||
|
}
|
||||||
if (!cStartUrl().isEmpty()) {
|
if (!cStartUrl().isEmpty()) {
|
||||||
commands += qsl("OPEN:") + _escapeTo7bit(cStartUrl()) + ';';
|
commands += qsl("OPEN:") + _escapeTo7bit(cStartUrl()) + ';';
|
||||||
} else if (cQuit()) {
|
} else if (cQuit()) {
|
||||||
|
@ -438,6 +441,8 @@ void Sandbox::readClients() {
|
||||||
if (cSendPaths().isEmpty()) {
|
if (cSendPaths().isEmpty()) {
|
||||||
toSend.append(_escapeFrom7bit(cmds.mid(from + 5, to - from - 5)));
|
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:"))) {
|
} else if (cmd.startsWith(qsl("OPEN:"))) {
|
||||||
startUrl = _escapeFrom7bit(cmds.mid(from + 5, to - from - 5)).mid(0, 8192);
|
startUrl = _escapeFrom7bit(cmds.mid(from + 5, to - from - 5)).mid(0, 8192);
|
||||||
auto activateRequired = StartUrlRequiresActivate(startUrl);
|
auto activateRequired = StartUrlRequiresActivate(startUrl);
|
||||||
|
|
Loading…
Reference in New Issue