xfrun4 + dbus

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Tue Feb 7 16:54:11 CET 2006

Jani Monoses wrote:
>>xfce_run_dialog (const gchar *working_directory,
>>                 GdkScreen   *screen,
>>                 GError     **error)
>>  gboolean result = FALSE;
>>  gchar   *display_name;
>>  if (G_UNLIKELY (screen == NULL))
>>    screen = gdk_screen_get_default ();
> I was wondering seeing G_UNLIKEY used so much whether it is worth using 
> it in functions which are rarely called and there's no perceivable 
> benefit to a branch optimisation, especially since most things are not
> CPU bound?

I use it mainly to remind myself that some block is unlikely/likely to
be executed according to the current program logic. It highlights the
common code path (and it gives some hints to the compiler, but this
doesn't do much for i386).

>>  display_name = gdk_screen_make_display_name (screen);
>>  ...
>>  g_free (display_name);
>>  return result;
>>The working directory should always be specified, because else the user
>>might invoke xfrun4 from "/whatever/directory", which contains a file
>>"foo", and xfrun4 will be unable to complete "f" to "foo", because the
>>daemon was initially started in the home dir.
> what should the working dir be considered when pressing the xfrun 
> shortcut? The users home?

The xfrun4 utility should always specify the current path here (the
current path of xfrun4, not xfrun-daemon!).

That is if you run xfrun4 from a terminal, it will use the shell's
current folder as current folder for the dialog. If you run it from the
shortcuts manager it will use the directory in which xfce-mcs-manager
was started (most probably the home dir).

> Jani


More information about the Xfce4-dev mailing list