Skip to content

Use "activate" and "open" GApplication signal handlers

This MR completes !30 (merged), as discussed in its header and in !30 (comment 16359). It is more justified after !33 (merged), because from the moment we always propose something to the user, there is no more reason to wait for a status when opening files in a new window (i.e. a cancellation by the user when he chooses the encoding does not mean a failure anymore).

Two new methods are now exposed to the gdbus command, which replace the old method LaunchFiles:

  • org.freedesktop.Application.Activate to open an empty document in a new window. It is called by
gdbus call --session --dest=org.xfce.mousepad --object-path /org/xfce/mousepad --method org.freedesktop.Application.Activate {}

One can also use org.gtk.Application.Activate with exactly the same syntax.

  • org.freedesktop.Application.Open to open files in a new window. It is called by
gdbus call --session --dest=org.xfce.mousepad --object-path /org/xfce/mousepad --method org.freedesktop.Application.Open "['uri_1', 'uri_2', …, 'uri_n']" {}

One can also use org.gtk.Application.Open by adding an empty string ("") as additional second argument.

The uri_i must be valid uris in the sense that g_filename_from_uri() doesn't return NULL (e.g. file:///path/to/file), else an error message coming from this function will be printed on stderr for each invalid uri.

Edited by Gaël Bonithon

Merge request reports

Loading