You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.2 KiB
Plaintext

/*! \page singleinstance How To Enable Single Instance Support For the Application
Usually user wants his application to be run as a single instance. This means,
that if the launched application is already running, the existing application
window is activated and no new application processes are started.
This can be achieved by adding --single-instance to the invoker
command in the .desktop file:
\verbatim
[Desktop Entry]
Type=Application
Name=My Application
Exec=/usr/bin/invoker --single-instance --type=e /usr/bin/myApp
\endverbatim
As a result, a lock file
\c /var/run/single-instance-locks/usr/bin/myApp/instance.lock is created.
If applauncherd cannot acquire the lock, it tries to find the corresponding
window and activates it.
Single-instance functionality requires that the shown window belongs to the invoked
application binary. For example if the invoked application starts a new application
as a plugin and the plugin shows the window, single-instance could be used only if
plugin's window XProperty WM_COMMAND is manually set to correspond with the application
name used in the single-instance lock file.
Consider using --single-instance instead of the single instance functionality
provided by D-Bus, because it very likely is much faster.
*/