mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Don't use window title for IPC.
This commit is contained in:
parent
6288da2f3d
commit
c49dac57b7
12 changed files with 156 additions and 66 deletions
|
@ -48,7 +48,32 @@ PreLaunchWindow::PreLaunchWindow(QString title) {
|
||||||
int paddingVertical = (_size / 2);
|
int paddingVertical = (_size / 2);
|
||||||
int paddingHorizontal = _size;
|
int paddingHorizontal = _size;
|
||||||
int borderRadius = (_size / 5);
|
int borderRadius = (_size / 5);
|
||||||
setStyleSheet(u"QPushButton { padding: %1px %2px; background-color: #ffffff; border-radius: %3px; }\nQPushButton#confirm:hover, QPushButton#cancel:hover { background-color: #e3f1fa; color: #2f9fea; }\nQPushButton#confirm { color: #2f9fea; }\nQPushButton#cancel { color: #aeaeae; }\nQLineEdit { border: 1px solid #e0e0e0; padding: 5px; }\nQLineEdit:focus { border: 2px solid #37a1de; padding: 4px; }"_q.arg(paddingVertical).arg(paddingHorizontal).arg(borderRadius));
|
setStyleSheet(uR"(
|
||||||
|
QPushButton {
|
||||||
|
padding: %1px %2px;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: %3px;
|
||||||
|
}
|
||||||
|
QPushButton#confirm:hover,
|
||||||
|
QPushButton#cancel:hover {
|
||||||
|
background-color: #e3f1fa;
|
||||||
|
color: #2f9fea;
|
||||||
|
}
|
||||||
|
QPushButton#confirm {
|
||||||
|
color: #2f9fea;
|
||||||
|
}
|
||||||
|
QPushButton#cancel {
|
||||||
|
color: #aeaeae;
|
||||||
|
}
|
||||||
|
QLineEdit {
|
||||||
|
border: 1px solid #e0e0e0;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
QLineEdit:focus {
|
||||||
|
border: 2px solid #37a1de;
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
)"_q.arg(paddingVertical).arg(paddingHorizontal).arg(borderRadius));
|
||||||
if (!PreLaunchWindowInstance) {
|
if (!PreLaunchWindowInstance) {
|
||||||
PreLaunchWindowInstance = this;
|
PreLaunchWindowInstance = this;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +82,7 @@ PreLaunchWindow::PreLaunchWindow(QString title) {
|
||||||
void PreLaunchWindow::activate() {
|
void PreLaunchWindow::activate() {
|
||||||
setWindowState(windowState() & ~Qt::WindowMinimized);
|
setWindowState(windowState() & ~Qt::WindowMinimized);
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
psActivateProcess();
|
Platform::ActivateThisProcess();
|
||||||
raise();
|
raise();
|
||||||
activateWindow();
|
activateWindow();
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,8 +36,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
namespace Core {
|
namespace Core {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr auto kEmptyPidForCommandResponse = 0ULL;
|
|
||||||
|
|
||||||
QChar _toHex(ushort v) {
|
QChar _toHex(ushort v) {
|
||||||
v = v & 0x000F;
|
v = v & 0x000F;
|
||||||
return QChar::fromLatin1((v >= 10) ? ('a' + (v - 10)) : ('0' + v));
|
return QChar::fromLatin1((v >= 10) ? ('a' + (v - 10)) : ('0' + v));
|
||||||
|
@ -304,17 +302,21 @@ void Sandbox::socketReading() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_localSocketReadData.append(_localSocket.readAll());
|
_localSocketReadData.append(_localSocket.readAll());
|
||||||
if (QRegularExpression("RES:(\\d+);").match(_localSocketReadData).hasMatch()) {
|
const auto m = QRegularExpression(u"RES:(\\d+)_(\\d+);"_q).match(
|
||||||
uint64 pid = base::StringViewMid(
|
_localSocketReadData);
|
||||||
_localSocketReadData,
|
if (!m.hasMatch()) {
|
||||||
4,
|
return;
|
||||||
_localSocketReadData.length() - 5).toULongLong();
|
|
||||||
if (pid != kEmptyPidForCommandResponse) {
|
|
||||||
psActivateProcess(pid);
|
|
||||||
}
|
|
||||||
LOG(("Show command response received, pid = %1, activating and quitting...").arg(pid));
|
|
||||||
return Quit();
|
|
||||||
}
|
}
|
||||||
|
const auto processId = m.capturedView(1).toULongLong();
|
||||||
|
const auto windowId = m.capturedView(2).toULongLong();
|
||||||
|
if (windowId) {
|
||||||
|
Platform::ActivateOtherProcess(processId, windowId);
|
||||||
|
}
|
||||||
|
LOG(("Show command response received, processId = %1, windowId = %2, "
|
||||||
|
"activating and quitting..."
|
||||||
|
).arg(processId
|
||||||
|
).arg(windowId));
|
||||||
|
return Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sandbox::socketError(QLocalSocket::LocalSocketError e) {
|
void Sandbox::socketError(QLocalSocket::LocalSocketError e) {
|
||||||
|
@ -432,8 +434,9 @@ void Sandbox::readClients() {
|
||||||
for (int32 to = cmds.indexOf(QChar(';'), from); to >= from; to = (from < l) ? cmds.indexOf(QChar(';'), from) : -1) {
|
for (int32 to = cmds.indexOf(QChar(';'), from); to >= from; to = (from < l) ? cmds.indexOf(QChar(';'), from) : -1) {
|
||||||
auto cmd = base::StringViewMid(cmds, from, to - from);
|
auto cmd = base::StringViewMid(cmds, from, to - from);
|
||||||
if (cmd.startsWith(u"CMD:"_q)) {
|
if (cmd.startsWith(u"CMD:"_q)) {
|
||||||
execExternal(cmds.mid(from + 4, to - from - 4));
|
const auto processId = QApplication::applicationPid();
|
||||||
const auto response = u"RES:%1;"_q.arg(QApplication::applicationPid()).toLatin1();
|
const auto windowId = execExternal(cmds.mid(from + 4, to - from - 4));
|
||||||
|
const auto response = u"RES:%1_%2;"_q.arg(processId).arg(windowId).toLatin1();
|
||||||
i->first->write(response.data(), response.size());
|
i->first->write(response.data(), response.size());
|
||||||
} else if (cmd.startsWith(u"SEND:"_q)) {
|
} else if (cmd.startsWith(u"SEND:"_q)) {
|
||||||
if (cSendPaths().isEmpty()) {
|
if (cSendPaths().isEmpty()) {
|
||||||
|
@ -443,14 +446,12 @@ void Sandbox::readClients() {
|
||||||
qputenv("XDG_ACTIVATION_TOKEN", _escapeFrom7bit(cmds.mid(from + 21, to - from - 21)).toUtf8());
|
qputenv("XDG_ACTIVATION_TOKEN", _escapeFrom7bit(cmds.mid(from + 21, to - from - 21)).toUtf8());
|
||||||
} else if (cmd.startsWith(u"OPEN:"_q)) {
|
} else if (cmd.startsWith(u"OPEN:"_q)) {
|
||||||
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);
|
const auto activationRequired = StartUrlRequiresActivate(startUrl);
|
||||||
if (activateRequired) {
|
const auto processId = QApplication::applicationPid();
|
||||||
execExternal("show");
|
const auto windowId = activationRequired
|
||||||
}
|
? execExternal("show")
|
||||||
const auto responsePid = activateRequired
|
: 0;
|
||||||
? QApplication::applicationPid()
|
const auto response = u"RES:%1_%2;"_q.arg(processId).arg(windowId).toLatin1();
|
||||||
: kEmptyPidForCommandResponse;
|
|
||||||
const auto response = u"RES:%1;"_q.arg(responsePid).toLatin1();
|
|
||||||
i->first->write(response.data(), response.size());
|
i->first->write(response.data(), response.size());
|
||||||
} else {
|
} else {
|
||||||
LOG(("Sandbox Error: unknown command %1 passed in local socket").arg(cmd.toString()));
|
LOG(("Sandbox Error: unknown command %1 passed in local socket").arg(cmd.toString()));
|
||||||
|
@ -649,17 +650,21 @@ void Sandbox::closeApplication() {
|
||||||
_updateChecker = nullptr;
|
_updateChecker = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sandbox::execExternal(const QString &cmd) {
|
uint64 Sandbox::execExternal(const QString &cmd) {
|
||||||
DEBUG_LOG(("Sandbox Info: executing external command '%1'").arg(cmd));
|
DEBUG_LOG(("Sandbox Info: executing external command '%1'").arg(cmd));
|
||||||
if (cmd == "show") {
|
if (cmd == "show") {
|
||||||
if (Core::IsAppLaunched() && Core::App().primaryWindow()) {
|
if (Core::IsAppLaunched() && Core::App().primaryWindow()) {
|
||||||
Core::App().primaryWindow()->activate();
|
const auto window = Core::App().primaryWindow();
|
||||||
} else if (PreLaunchWindow::instance()) {
|
window->activate();
|
||||||
PreLaunchWindow::instance()->activate();
|
return Platform::ActivationWindowId(window->widget());
|
||||||
|
} else if (const auto window = PreLaunchWindow::instance()) {
|
||||||
|
window->activate();
|
||||||
|
return Platform::ActivationWindowId(window);
|
||||||
}
|
}
|
||||||
} else if (cmd == "quit") {
|
} else if (cmd == "quit") {
|
||||||
Quit();
|
Quit();
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
|
|
@ -95,7 +95,9 @@ private:
|
||||||
void singleInstanceChecked();
|
void singleInstanceChecked();
|
||||||
void launchApplication();
|
void launchApplication();
|
||||||
void setupScreenScale();
|
void setupScreenScale();
|
||||||
void execExternal(const QString &cmd);
|
|
||||||
|
// Return window id for activation.
|
||||||
|
uint64 execExternal(const QString &cmd);
|
||||||
|
|
||||||
// Single instance application
|
// Single instance application
|
||||||
void socketConnected();
|
void socketConnected();
|
||||||
|
|
|
@ -684,10 +684,6 @@ bool SkipTaskbarSupported() {
|
||||||
|
|
||||||
} // namespace Platform
|
} // namespace Platform
|
||||||
|
|
||||||
void psActivateProcess(uint64 pid) {
|
|
||||||
// objc_activateProgram();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString psAppDataPath() {
|
QString psAppDataPath() {
|
||||||
// Previously we used ~/.TelegramDesktop, so look there first.
|
// Previously we used ~/.TelegramDesktop, so look there first.
|
||||||
// If we find data there, we should still use it.
|
// If we find data there, we should still use it.
|
||||||
|
|
|
@ -24,6 +24,16 @@ inline void WriteCrashDumpDetails() {
|
||||||
inline void AutostartRequestStateFromSystem(Fn<void(bool)> callback) {
|
inline void AutostartRequestStateFromSystem(Fn<void(bool)> callback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void ActivateThisProcess() {
|
||||||
|
}
|
||||||
|
|
||||||
|
inline uint64 ActivationWindowId(not_null<QWidget*> window) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void ActivateOtherProcess(uint64 processId, uint64 windowId) {
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Platform
|
} // namespace Platform
|
||||||
|
|
||||||
inline void psCheckLocalSocket(const QString &serverName) {
|
inline void psCheckLocalSocket(const QString &serverName) {
|
||||||
|
@ -33,7 +43,6 @@ inline void psCheckLocalSocket(const QString &serverName) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void psActivateProcess(uint64 pid = 0);
|
|
||||||
QString psAppDataPath();
|
QString psAppDataPath();
|
||||||
void psSendToMenu(bool send, bool silent = false);
|
void psSendToMenu(bool send, bool silent = false);
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,15 @@ inline bool SkipTaskbarSupported() {
|
||||||
inline void InstallLauncher(bool force) {
|
inline void InstallLauncher(bool force) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ActivateThisProcess();
|
||||||
|
|
||||||
|
inline uint64 ActivationWindowId(not_null<QWidget*> window) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void ActivateOtherProcess(uint64 processId, uint64 windowId) {
|
||||||
|
}
|
||||||
|
|
||||||
namespace ThirdParty {
|
namespace ThirdParty {
|
||||||
|
|
||||||
inline void start() {
|
inline void start() {
|
||||||
|
@ -54,7 +63,6 @@ inline void psCheckLocalSocket(const QString &serverName) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void psActivateProcess(uint64 pid = 0);
|
|
||||||
QString psAppDataPath();
|
QString psAppDataPath();
|
||||||
void psSendToMenu(bool send, bool silent = false);
|
void psSendToMenu(bool send, bool silent = false);
|
||||||
|
|
||||||
|
|
|
@ -35,13 +35,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include <mach-o/dyld.h>
|
#include <mach-o/dyld.h>
|
||||||
#include <AVFoundation/AVFoundation.h>
|
#include <AVFoundation/AVFoundation.h>
|
||||||
|
|
||||||
void psActivateProcess(uint64 pid) {
|
|
||||||
if (!pid) {
|
|
||||||
const auto window = Core::App().activeWindow();
|
|
||||||
objc_activateProgram(window ? window->widget()->winId() : 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString psAppDataPath() {
|
QString psAppDataPath() {
|
||||||
return objc_appDataPath();
|
return objc_appDataPath();
|
||||||
}
|
}
|
||||||
|
@ -194,6 +187,11 @@ bool AutostartSkip() {
|
||||||
void NewVersionLaunched(int oldVersion) {
|
void NewVersionLaunched(int oldVersion) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ActivateThisProcess() {
|
||||||
|
const auto window = Core::App().activeWindow();
|
||||||
|
objc_activateProgram(window ? window->widget()->winId() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Platform
|
} // namespace Platform
|
||||||
|
|
||||||
void psSendToMenu(bool send, bool silent) {
|
void psSendToMenu(bool send, bool silent) {
|
||||||
|
|
|
@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/widgets/popup_menu.h"
|
#include "ui/widgets/popup_menu.h"
|
||||||
#include "ui/ui_utility.h"
|
#include "ui/ui_utility.h"
|
||||||
#include "window/themes/window_theme.h"
|
#include "window/themes/window_theme.h"
|
||||||
|
#include "window/window_controller.h"
|
||||||
#include "history/history.h"
|
#include "history/history.h"
|
||||||
|
|
||||||
#include <QtWidgets/QDesktopWidget>
|
#include <QtWidgets/QDesktopWidget>
|
||||||
|
@ -171,6 +172,8 @@ MainWindow::MainWindow(not_null<Window::Controller*> controller)
|
||||||
|
|
||||||
setupNativeWindowFrame();
|
setupNativeWindowFrame();
|
||||||
|
|
||||||
|
SetWindowPriority(this, controller->isPrimary() ? 2 : 1);
|
||||||
|
|
||||||
using namespace rpl::mappers;
|
using namespace rpl::mappers;
|
||||||
Core::App().appDeactivatedValue(
|
Core::App().appDeactivatedValue(
|
||||||
) | rpl::distinct_until_changed(
|
) | rpl::distinct_until_changed(
|
||||||
|
|
|
@ -615,7 +615,9 @@ void Manager::Private::handleActivation(const ToastActivation &activation) {
|
||||||
).arg(activation.args
|
).arg(activation.args
|
||||||
).arg(my
|
).arg(my
|
||||||
).arg(pid));
|
).arg(pid));
|
||||||
psActivateProcess(pid);
|
const auto processId = pid;
|
||||||
|
const auto windowId = 0; // Activate some window.
|
||||||
|
Platform::ActivateOtherProcess(processId, windowId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto action = parsed.value("action");
|
const auto action = parsed.value("action");
|
||||||
|
|
|
@ -68,7 +68,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#define WM_NCPOINTERUP 0x0243
|
#define WM_NCPOINTERUP 0x0243
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace Platform;
|
using namespace ::Platform;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -77,24 +77,39 @@ bool finished = true;
|
||||||
QMargins simpleMargins, margins;
|
QMargins simpleMargins, margins;
|
||||||
HICON bigIcon = 0, smallIcon = 0, overlayIcon = 0;
|
HICON bigIcon = 0, smallIcon = 0, overlayIcon = 0;
|
||||||
|
|
||||||
BOOL CALLBACK ActivateProcessByPid(HWND hWnd, LPARAM lParam) {
|
[[nodiscard]] uint64 WindowIdFromHWND(HWND value) {
|
||||||
uint64 &processId(*(uint64*)lParam);
|
return (reinterpret_cast<uint64>(value) & 0xFFFFFFFFULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct FindToActivateRequest {
|
||||||
|
uint64 processId = 0;
|
||||||
|
uint64 windowId = 0;
|
||||||
|
HWND result = nullptr;
|
||||||
|
uint32 resultLevel = 0; // Larger is better.
|
||||||
|
};
|
||||||
|
|
||||||
|
BOOL CALLBACK FindToActivate(HWND hwnd, LPARAM lParam) {
|
||||||
|
const auto request = reinterpret_cast<FindToActivateRequest*>(lParam);
|
||||||
|
|
||||||
DWORD dwProcessId;
|
DWORD dwProcessId;
|
||||||
::GetWindowThreadProcessId(hWnd, &dwProcessId);
|
::GetWindowThreadProcessId(hwnd, &dwProcessId);
|
||||||
|
|
||||||
if ((uint64)dwProcessId == processId) { // found top-level window
|
if ((uint64)dwProcessId != request->processId) {
|
||||||
static const int32 nameBufSize = 1024;
|
return TRUE;
|
||||||
WCHAR nameBuf[nameBufSize];
|
|
||||||
int32 len = GetWindowText(hWnd, nameBuf, nameBufSize);
|
|
||||||
if (len && len < nameBufSize) {
|
|
||||||
if (QRegularExpression(u"^Telegram(\\s*\\(\\d+\\))?$"_q).match(QString::fromStdWString(nameBuf)).hasMatch()) {
|
|
||||||
BOOL res = ::SetForegroundWindow(hWnd);
|
|
||||||
::SetFocus(hWnd);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// Found a Top-Level window.
|
||||||
|
auto level = 0;
|
||||||
|
if (WindowIdFromHWND(hwnd) == request->windowId) {
|
||||||
|
request->result = hwnd;
|
||||||
|
request->resultLevel = 3;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
const auto data = static_cast<uint32>(GetWindowLong(hwnd, GWL_USERDATA));
|
||||||
|
if ((data != 1 && data != 2) || (data <= request->resultLevel)) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
request->result = hwnd;
|
||||||
|
request->resultLevel = data;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,12 +233,6 @@ bool ManageAppLink(
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
void psActivateProcess(uint64 pid) {
|
|
||||||
if (pid) {
|
|
||||||
::EnumWindows((WNDENUMPROC)ActivateProcessByPid, (LPARAM)&pid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString psAppDataPath() {
|
QString psAppDataPath() {
|
||||||
static const int maxFileLen = MAX_PATH * 10;
|
static const int maxFileLen = MAX_PATH * 10;
|
||||||
WCHAR wstrPath[maxFileLen];
|
WCHAR wstrPath[maxFileLen];
|
||||||
|
@ -488,6 +497,29 @@ void WriteCrashDumpDetails() {
|
||||||
#endif // DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#endif // DESKTOP_APP_DISABLE_CRASH_REPORTS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetWindowPriority(not_null<QWidget*> window, uint32 priority) {
|
||||||
|
const auto hwnd = reinterpret_cast<HWND>(window->winId());
|
||||||
|
Assert(hwnd != nullptr);
|
||||||
|
|
||||||
|
SetWindowLong(hwnd, GWL_USERDATA, static_cast<LONG>(priority));
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64 ActivationWindowId(not_null<QWidget*> window) {
|
||||||
|
return WindowIdFromHWND(reinterpret_cast<HWND>(window->winId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActivateOtherProcess(uint64 processId, uint64 windowId) {
|
||||||
|
auto request = FindToActivateRequest{
|
||||||
|
.processId = processId,
|
||||||
|
.windowId = windowId,
|
||||||
|
};
|
||||||
|
::EnumWindows((WNDENUMPROC)FindToActivate, (LPARAM)&request);
|
||||||
|
if (const auto hwnd = request.result) {
|
||||||
|
::SetForegroundWindow(hwnd);
|
||||||
|
::SetFocus(hwnd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Platform
|
} // namespace Platform
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
|
@ -30,6 +30,17 @@ inline bool SkipTaskbarSupported() {
|
||||||
inline void InstallLauncher(bool force) {
|
inline void InstallLauncher(bool force) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void ActivateThisProcess() {
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1 - secondary, 2 - primary.
|
||||||
|
void SetWindowPriority(not_null<QWidget*> window, uint32 priority);
|
||||||
|
|
||||||
|
[[nodiscard]] uint64 ActivationWindowId(not_null<QWidget*> window);
|
||||||
|
|
||||||
|
// Activate window with windowId (if found) or the largest priority.
|
||||||
|
void ActivateOtherProcess(uint64 processId, uint64 windowId);
|
||||||
|
|
||||||
namespace ThirdParty {
|
namespace ThirdParty {
|
||||||
|
|
||||||
void start();
|
void start();
|
||||||
|
@ -43,7 +54,6 @@ inline void finish() {
|
||||||
inline void psCheckLocalSocket(const QString &) {
|
inline void psCheckLocalSocket(const QString &) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void psActivateProcess(uint64 pid = 0);
|
|
||||||
QString psAppDataPath();
|
QString psAppDataPath();
|
||||||
QString psAppDataPathOld();
|
QString psAppDataPathOld();
|
||||||
void psSendToMenu(bool send, bool silent = false);
|
void psSendToMenu(bool send, bool silent = false);
|
||||||
|
|
|
@ -533,7 +533,7 @@ void MainWindow::activate() {
|
||||||
bool wasHidden = !isVisible();
|
bool wasHidden = !isVisible();
|
||||||
setWindowState(windowState() & ~Qt::WindowMinimized);
|
setWindowState(windowState() & ~Qt::WindowMinimized);
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
psActivateProcess();
|
Platform::ActivateThisProcess();
|
||||||
raise();
|
raise();
|
||||||
activateWindow();
|
activateWindow();
|
||||||
controller().updateIsActiveFocus();
|
controller().updateIsActiveFocus();
|
||||||
|
|
Loading…
Add table
Reference in a new issue