Application control¶
The compositor is able to control the behaviour of running applications using IPC socket communication with the Linux Kernel. It is also possible to start new instances of applications.
The following signals are implemented:
Signal | # | Description |
---|---|---|
SIGCONT | 18 | Continue execution after being paused by the SIGSTOP signal. |
SIGSTOP | 19 | Pause execution by not receiving any more CPU cycles. |
The signalling is implemented using the C++ POSIX standard int kill(pid_t pid, int sig)
function.
Application control is used by the compositor to control the minimized mode from parameter X-Minimized Mode
of the desktop file configuration. If minimized mode is set to Paused
, the application will instantly be paused while it is being registered in the compositor.
Controller Class¶
In the implementation of the compositor, each Application object has access to the Controller class which has a few methods to control the execution of the application.
pauseApplication¶
The pauseApplication method pauses a running application by sending the SIGSTOP signal. This is useful when an application is started but is minimized or otherwise not visible for the user, to save CPU load.
If the user interface of the application is visible while it is being paused, the UI will still be shown but is completely non-responsive.
resumeApplication¶
The resumeApplication method resumes execution of a paused application. It is normally used to invoke application after the pauseApplication call.
Read more¶
List of Linux/Unix signals
The kill shell command
The kill programmatically using C