Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks to the xfce4-weather-plugin source I found this as a practical solution:</p> <pre><code>gchar *str = g_strdup_printf("exo-open --launch WebBrowser %s", url); g_spawn_command_line_async(str, NULL); g_free(str); </code></pre> <p>Considering the plugin is part of the core xfce apps I will assume it's the appropriate way to do it. I also found out about exo_execute_preferred_application() however I didn't feel like including another library.</p> <p>A variation on this theme can be found here: <a href="http://git.xfce.org/xfce/libxfce4ui/tree/libxfce4ui/xfce-dialogs.c#n66" rel="nofollow">http://git.xfce.org/xfce/libxfce4ui/tree/libxfce4ui/xfce-dialogs.c#n66</a> Which may be preferable because it will fall back to gtk_show_uri() in case exo is not installed. Although it's possible gtk_show_uri() may not work due to lack of gvfs on xfce systems (user is using xfce after all, not gnome). The xfce panel uses this function to load a url.</p> <pre><code>static void xfce_dialog_show_help_uri (GdkScreen *screen, GtkWindow *parent, GString *uri) { GError *error = NULL; gchar *path; gchar *cmd; gboolean result; g_return_if_fail (GDK_IS_SCREEN (screen)); g_return_if_fail (parent == NULL || GTK_IS_WINDOW (parent)); path = g_find_program_in_path ("exo-open"); if (G_LIKELY (path != NULL)) { cmd = g_strdup_printf ("%s --launch WebBrowser '%s'", path, uri-&gt;str); result = xfce_spawn_command_line_on_screen (screen, cmd, FALSE, TRUE, &amp;error); g_free (path); g_free (cmd); } else { /* not very likely to happen, but it is possible exo is not installed */ result = gtk_show_uri (screen, uri-&gt;str, gtk_get_current_event_time (), &amp;error); } if (!result) { xfce_dialog_show_error (parent, error, _("Failed to open web browser for online documentation")); g_error_free (error); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload