Application Specification

This page attempts to document some ideas about how we can have applications that are more accessible (introspectable) by the desktop environment.

Right now some of these ideas are implemented in GLib in the form of GApplication. This page attempts to document the planned expansion of this idea. Many parts are still undefined, but this way the defined parts will at least be documented.

The final goal is to get all of this specified at the freedesktop.org level (at which point we will use the org.freedesktop namespace). Reference implementation will be the first step, however. Some communication has been made with KDE developers about these ideas and it's clear that there is some substantial common ground for standardisation.

This vision of the future is the view of RyanLortie. Others may disagree.

.desktop File Changes

A new ApplicationID field will be added to desktop files. This will be in the same form as D-Bus bus names (and chosen in the same way).

There will be some other properties that indicate if launching via this D-Bus name is supported.

D-Bus Application Launching

Using the GApplication D-Bus API with D-Bus activation.

Actions via D-Bus

Using GApplication API as well.

New X11 Properties

These properties are now set by GTK on created windows, before they are mapped. The prefix _GTK may change in the future (along with some implementation details) if other toolkits want to substantially buy-in to this.

None of the properties will ever change while the window is mapped. In the usual case, they will be set immediately after the window is created and never change thereafter.

Presently, all object paths in X properties are assumed to exist on the same bus destination. This may change in the future by allowing the destination name to be given as part of the object path (eg: ":1:143/org/gnome/bloatpad"). To repeat for clarity: this prefixing is not presently supported.

_GTK_APPLICATION_ID

_GTK_APPLICATION_ID, STRING

This property contains the unique application identifier of the application that is displaying this window. This name is of the form that is suitable for use as a well-known name on D-Bus and is subject to the same restrictions. It should be chosen in the same way.

A client process should set this property on each window it displays. Separate processes should use the same property if their windows are to be treated as belonging to a single application.

The name is not necessarily owned by the application on any bus. It is merely used for identification and grouping purposes.

The same identifier should appear in the desktop file as the ApplicationID key.

_GTK_UNIQUE_BUS_NAME

_GTK_UNIQUE_BUS_NAME, STRING

This property contains the unique D-Bus name of the application, as handed out by the session D-Bus for the session controlling the X server. A well-known D-Bus name should not appear here.

A client process should set this property on each window that it displays. Generally there will be a one-to-one relationship between processes and bus names.

Use of different bus names for windows from the same process only makes sense if that process has multiple connections to D-Bus. Use of the same bus name within different processes only makes sense if there is some forwarding mechanism in place between those processes.

_GTK_APPLICATION_OBJECT_PATH

_GTK_APPLICATION_OBJECT_PATH, STRING

This property contains the D-Bus object path for the application. The object path can be found at the destination specified by the _GTK_UNIQUE_BUS_NAME property, on the session bus.

The usual 'org.gtk.Application' interface is implemented at this object path, along with an action group. This action group is the action group that receives 'app.' actions as specified in the menus.

_GTK_WINDOW_OBJECT_PATH

_GTK_WINDOW_OBJECT_PATH, STRING

This property contains the D-Bus object path for the window. The object path can be found at the destination specified by the _GTK_UNIQUE_BUS_NAME property, on the session bus.

The interfaces implemented at the D-Bus object path for the window are application-specific, but there is at least an action group exported here. This action group is the action group that receives 'win.' actions as specified in the menus.

_GTK_APP_MENU_OBJECT_PATH

_GTK_APP_MENU_OBJECT_PATH, STRING

This property contains the D-Bus object path for the application menu (ie: the one that gnome-shell shows). The object path can be found at the destination specified by the _GTK_UNIQUE_BUS_NAME property, on the session bus.

_GTK_MENUBAR_OBJECT_PATH

_GTK_APP_MENU_OBJECT_PATH, STRING

This property contains the D-Bus object path for the menubar (ie: the one that Unity shows). The object path can be found at the destination specified by the _GTK_UNIQUE_BUS_NAME property, on the session bus.

Attic/ApplicationSpecification (last edited 2013-12-03 17:52:20 by WilliamJonMcCann)