diff options
author | Josh Rickmar <jrick@devio.us> | 2012-08-29 10:22:21 -0400 |
---|---|---|
committer | Josh Rickmar <jrick@devio.us> | 2012-08-29 10:22:21 -0400 |
commit | 2b4bb0278550e3d46cff5798661f6f6f9acb1d3d (patch) | |
tree | ab2a47a5c4919f1170c2fcde9c2f3f225c98a98e | |
parent | 1f5946121c0e1d54c88f7b8a5ced05847195c611 (diff) | |
download | xombrero-2b4bb0278550e3d46cff5798661f6f6f9acb1d3d.tar.gz |
Make all new tabs open in new windows in tabless mode
-rw-r--r-- | xombrero.1 | 1 | ||||
-rw-r--r-- | xombrero.c | 14 |
2 files changed, 14 insertions, 1 deletions
diff --git a/xombrero.1 b/xombrero.1 index 4bbb5f9..1b57c3b 100644 --- a/xombrero.1 +++ b/xombrero.1 @@ -76,6 +76,7 @@ Open session that was saved with ":session save" command. Disable visualization of tabs. .It Fl t Disable tabs. +Pages that would open in tabs open in new windows instead. .It Fl V Display version and exit. .El diff --git a/xombrero.c b/xombrero.c index 3602879..8d78748 100644 --- a/xombrero.c +++ b/xombrero.c @@ -7720,6 +7720,7 @@ create_new_tab(char *title, struct undo *u, int focus, int position) GtkWidget *b, *bb; WebKitWebHistoryItem *item; GList *items; + char *sv[3]; #if !GTK_CHECK_VERSION(3, 0, 0) GdkColor color; #endif @@ -7727,7 +7728,18 @@ create_new_tab(char *title, struct undo *u, int focus, int position) DNPRINTF(XT_D_TAB, "create_new_tab: title %s focus %d\n", title, focus); if (tabless && !TAILQ_EMPTY(&tabs)) { - DNPRINTF(XT_D_TAB, "create_new_tab: new tab rejected\n"); + if (single_instance) { + DNPRINTF(XT_D_TAB, + "create_new_tab: new tab rejected\n"); + return (NULL); + } + sv[0] = start_argv[0]; + sv[1] = title; + sv[2] = (char *)NULL; + if (!g_spawn_async(NULL, sv, NULL, G_SPAWN_SEARCH_PATH, + NULL, NULL, NULL, NULL)) + show_oops(NULL, "%s: could not spawn process", + __func__); return (NULL); } |