From 4f0365107283ce321da713baeab4d2aad0456baf Mon Sep 17 00:00:00 2001 From: Itay Grudev Date: Mon, 2 Oct 2017 12:17:41 +0100 Subject: Primary PID support (#36) * Added the ability to bring the primary application window to the foreground on Windows systems by adding an option flag. THis option can only be used in Windows development and in applications derived from QApplication with a QMainWindow object. Because the primary application needs to be instructed to go to the foreground, the option SecondaryNotification must also be set to use this functionality * Changed the ability to bring the primary application window to the front as discussed in itay-grudev/SingleApplication#31. Now the process ID of the primary application get stored and is accessible for other instances of the application. It is to the developer to bring the applications windows to the front. For convenience the accompanying readme now contains a paragraph with example of how to do this on Windows systems. * v3.0.9 Added SingleApplicationPrivate::primaryPid() --- singleapplication_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'singleapplication_p.h') diff --git a/singleapplication_p.h b/singleapplication_p.h index 833e731..856b33d 100644 --- a/singleapplication_p.h +++ b/singleapplication_p.h @@ -40,6 +40,7 @@ struct InstancesInfo { bool primary; quint32 secondary; + qint64 primaryPid; }; class SingleApplicationPrivate : public QObject { @@ -54,6 +55,7 @@ public: void startPrimary( bool resetMemory ); void startSecondary(); void connectToPrimary( int msecs, char connectionType ); + qint64 primaryPid(); #ifdef Q_OS_UNIX void crashHandler(); -- cgit v1.2.1