mirror of
https://github.com/tnodir/fort
synced 2024-11-15 07:45:22 +00:00
UI: ControlCommand: Allow other foreground windows
This commit is contained in:
parent
75e020cac8
commit
80fe138b14
@ -112,6 +112,8 @@ bool ControlManager::processCommandClient()
|
||||
if (args.isEmpty())
|
||||
return false;
|
||||
|
||||
OsUtil::allowOtherForegroundWindows(); // let the running instance to activate a window
|
||||
|
||||
return postCommand(command, args);
|
||||
}
|
||||
|
||||
|
@ -174,3 +174,8 @@ void OsUtil::setThreadIsBusy(bool on)
|
||||
// Works correct only on Windows 11+
|
||||
SetThreadExecutionState(ES_CONTINUOUS | (on ? ES_SYSTEM_REQUIRED : 0));
|
||||
}
|
||||
|
||||
bool OsUtil::allowOtherForegroundWindows()
|
||||
{
|
||||
return AllowSetForegroundWindow(ASFW_ANY);
|
||||
}
|
||||
|
@ -38,8 +38,9 @@ public:
|
||||
static void writeToConsole(const QString &line);
|
||||
|
||||
static bool setCurrentThreadName(const QString &name);
|
||||
|
||||
static void setThreadIsBusy(bool on);
|
||||
|
||||
static bool allowOtherForegroundWindows();
|
||||
};
|
||||
|
||||
#endif // OSUTIL_H
|
||||
|
@ -18,6 +18,7 @@ void WidgetWindow::showWidget(QWidget *w, bool activate)
|
||||
if (w->isMinimized()) {
|
||||
w->setWindowState(w->windowState() ^ Qt::WindowMinimized);
|
||||
}
|
||||
|
||||
w->show();
|
||||
w->raise();
|
||||
|
||||
|
@ -116,8 +116,10 @@ int main(int argc, char *argv[])
|
||||
ControlManager controlManager;
|
||||
ioc.setService<ControlManager>(controlManager);
|
||||
|
||||
if (controlManager.isCommandClient()) // Send control command to running instance
|
||||
if (controlManager.isCommandClient()) {
|
||||
// Send control command to running instance
|
||||
return controlManager.processCommandClient() ? 0 : FortErrorControl;
|
||||
}
|
||||
|
||||
// Setup Fort Manager
|
||||
FortManager::setupResources();
|
||||
|
Loading…
Reference in New Issue
Block a user