summaryrefslogtreecommitdiff
path: root/extra/xfce4-smartbookmark-plugin/use-exo-open-instead-of-xfbrowser4.patch
blob: 2543821820f44a0a5ed6d02e7b3081948a3c8531 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--- xfce4-smartbookmark-plugin-0.4.4/src/smartbookmark.c	
+++ xfce4-smartbookmark-plugin-0.4.4/src/smartbookmark.c	
@@ -75,18 +75,27 @@ XFCE_PANEL_PLUGIN_REGISTER_INTERNAL(smar
 
 static gboolean do_search(const char *url, const char *keyword)
 {
+    gchar *argv[] = { "exo-open", "--launch", "WebBrowser", NULL, NULL };
+    gchar *complete_url;
+    gboolean retval;
+    GError *error = NULL;
+
     DBG ("Do search");
-    gchar *execute;
-    gboolean success;
-    execute = g_strconcat("xfbrowser4  \"", url, NULL);//works better for me
-    //execute = g_strconcat("x-www-browser \"", url, NULL);
-    execute = g_strconcat(execute, keyword, NULL);
-    execute = g_strconcat(execute, "\"", NULL);
 
-    success = exec_command(execute);
-    g_free(execute);
+    complete_url = g_strconcat(url, keyword, NULL);
+    argv[3] = complete_url;
+
+    retval = g_spawn_async(NULL, (gchar **)argv, NULL,
+        G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, NULL, &error);
+
+    g_free(complete_url);
+
+    if (!retval) {
+        xfce_err("%s", error->message);
+        g_error_free(error);
+    }
 
-    return success;
+    return retval;
 }