[Xfce4-commits] <midori:master> Spawn new apps with the original executable name

Christian Dywan noreply at xfce.org
Mon Mar 22 03:00:01 CET 2010


Updating branch refs/heads/master
         to 9587fde97b5ecc0326cd49d4a57da15cfc605981 (commit)
       from e9a5857b31a4b6ebe5c867e42fd053a33cf64d25 (commit)

commit 9587fde97b5ecc0326cd49d4a57da15cfc605981
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sun Mar 21 23:53:59 2010 +0100

    Spawn new apps with the original executable name
    
    Opening a web app or private mode should open Midori from the
    same executable it was originally opened with.

 midori/midori-browser.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 909aced..68f6589 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -2214,6 +2214,15 @@ _action_tab_new_activate (GtkAction*     action,
 }
 
 static void
+midori_browser_spawn_app (const gchar* uri)
+{
+    const gchar* executable = sokoke_get_argv (NULL)[0];
+    gchar* command = g_strconcat (executable, " -a", NULL);
+    sokoke_spawn_program (command, uri, FALSE);
+    g_free (command);
+}
+
+static void
 _action_private_browsing_activate (GtkAction*     action,
                                    MidoriBrowser* browser)
 {
@@ -2222,9 +2231,9 @@ _action_private_browsing_activate (GtkAction*     action,
     {
         /* FIXME: Use the same binary that is running right now */
         if (*uri != '\0')
-            sokoke_spawn_program ("midori -a", uri, FALSE);
+            midori_browser_spawn_app (uri);
         else
-            sokoke_spawn_program ("midori -a", "about:blank", FALSE);
+            midori_browser_spawn_app ("about:blank");
     }
 }
 
@@ -3036,7 +3045,7 @@ midori_browser_open_bookmark (MidoriBrowser* browser,
 
     /* FIXME: Use the same binary that is running right now */
     if (katze_item_get_meta_integer (item, "app") != -1)
-        sokoke_spawn_program ("midori -a", uri_fixed, FALSE);
+        midori_browser_spawn_app (uri_fixed);
     else
     {
         midori_browser_set_current_uri (browser, uri_fixed);



More information about the Xfce4-commits mailing list