[Xfce4-commits] <midori:master> Support creating new windows by dragging tabs outside
Christian Dywan
noreply at xfce.org
Thu Aug 18 18:08:02 CEST 2011
Updating branch refs/heads/master
to 59a6438d5257b010e2a484762fdb3996aee0c4eb (commit)
from 49f15f741ee6de74e5d4de87ca30632f43687e7c (commit)
commit 59a6438d5257b010e2a484762fdb3996aee0c4eb
Author: Christian Dywan <christian at twotoasts.de>
Date: Thu Aug 18 18:06:34 2011 +0200
Support creating new windows by dragging tabs outside
midori/midori-browser.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 0404249..5f11127 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -5015,6 +5015,26 @@ midori_browser_notebook_reorder_tab_cb (GtkNotebook* notebook,
return TRUE;
}
+static GtkWidget*
+midori_browser_notebook_create_window_cb (GtkNotebook* notebook,
+ MidoriView* view,
+ gint x,
+ gint y,
+ MidoriBrowser* browser)
+{
+ MidoriBrowser* new_browser;
+ g_signal_emit (browser, signals[NEW_WINDOW], 0, NULL, &new_browser);
+ if (new_browser)
+ {
+ GtkWidget* new_notebook = katze_object_get_object (new_browser, "notebook");
+ g_object_unref (new_notebook);
+ gtk_window_move (GTK_WINDOW (browser), x, y);
+ return new_notebook;
+ }
+ else /* No MidoriApp, so this is app or private mode */
+ return NULL;
+}
+
static void
midori_browser_switch_tab_cb (GtkWidget* menuitem,
MidoriBrowser* browser)
@@ -6208,6 +6228,8 @@ midori_browser_init (MidoriBrowser* browser)
browser);
g_signal_connect (browser->notebook, "reorder-tab",
G_CALLBACK (midori_browser_notebook_reorder_tab_cb), NULL);
+ g_signal_connect (browser->notebook, "create-window",
+ G_CALLBACK (midori_browser_notebook_create_window_cb), browser);
gtk_widget_show (browser->notebook);
/* Inspector container */
More information about the Xfce4-commits
mailing list