Communication

The real communication between processes is initiated by the process calling gtk_unique_app_send_message() (from now on, the sender process). The sender process must find the window of the running instance (or receiver process) following the steps in the "discovery" phase; once the right window has been found, it must set the following properties on that window:

After setting these properties, the _GTK_UNIQUE_COMMAND (type: XA_STRING, format: 8) property must be set using one of these command strings:

Once the sender process has set the _GTK_UNIQUE_COMMAND property it should block until a PropertyNotify event has been sent on the _GTK_UNIQUE_RESPONSE property.

Meanwhile, the receiver process should have received the PropertyNotify event on the _GTK_UNIQUE_COMMAND property. The sender process should retrieve the values of the other properties set by the sender process and execute the command. Once the command has been completed, the sender process should set the _GTK_UNIQUE_RESPONSE (type: XA_STRING, format: 8) property with a response code between the following:

The 'fail' and 'invalid' response codes are reserved for error conditions inside the GtkUnique library.

The sender process should then receive a PropertyNotify event on the _GTK_UNIQUE_RESPONSE property, retrieve the value of the property and return the code to the user before terminating.