Launching .desktop files with GIO

Brian J. Tarricone brian at tarricone.org
Mon Aug 24 00:03:29 CEST 2009


On 08/23/2009 02:45 PM, Jannis Pohlmann wrote:
> 
> On Unixes one can create a GDesktopAppInfo from a filename and call
> g_app_info_launch() with an empty file list to call a desktop file
> without any arguments.
> 
> Here are two links to the API docs:
> http://library.gnome.org/devel/gio/2.18/gio-Desktop-file-based-GAppInfo.html
> http://library.gnome.org/devel/gio/2.18/GAppInfo.html
> 
> The launch() method takes a GAppLaunchContext argument. The
> GAppLaunchContext interface is implemented by GdkAppLaunchContext
> and that class allows to set things like display, screen and also a
> timestamp to be used for startup notification:
> 
> http://library.gnome.org/devel/gdk/stable/gdk-Application-launching.html

Excellent.  The only thing possibly missing is handling of the Terminal=
key.  And even if it's not missing, I imagine it doesn't run xfterm4 :-P
.  Not sure what to do about that; I know people have complained at
times when launching in terminal hasn't worked, so people do use it.

> Again, GDesktopAppInfo is only available when gio-unix-2.0 is
> available. I'm not sure why that is. Its obvious that the menu spec is
> only really being used on Unixes, but GDesktopAppInfo might still be
> useful for individual files. Dunno if that would be a problem for e.g.
> xfdesktop.

No, not at all.  I wouldn't expect someone to try to use it on another
OS, and if they do... they get to fix what breaks.

I'm completely fine with this.  As far as I'm concerned, we don't need
support for launching .desktop files in libxfce4ui with this here, as
long as we can figure out how to handle the Termina=true case.

	-brian



More information about the Xfce4-dev mailing list