[gnome-builder/editor-layout] tabs: disconnect close signal when removing tab.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/editor-layout] tabs: disconnect close signal when removing tab.
- Date: Mon, 1 Dec 2014 11:58:33 +0000 (UTC)
commit 76195703c4f8a33731876f45ca311e4e87d07325
Author: Christian Hergert <christian hergert me>
Date: Mon Dec 1 03:37:04 2014 -0800
tabs: disconnect close signal when removing tab.
src/tabs/gb-tab-stack.c | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 deletions(-)
---
diff --git a/src/tabs/gb-tab-stack.c b/src/tabs/gb-tab-stack.c
index aafae22..ebbe484 100644
--- a/src/tabs/gb-tab-stack.c
+++ b/src/tabs/gb-tab-stack.c
@@ -42,6 +42,9 @@ enum {
LAST_SIGNAL
};
+static void gb_tab_stack_tab_closed (GbTabStack *stack,
+ GbTab *tab);
+
static guint gSignals [LAST_SIGNAL];
GtkWidget *
@@ -50,6 +53,16 @@ gb_tab_stack_new (void)
return g_object_new (GB_TYPE_TAB_STACK, NULL);
}
+static gboolean
+gb_tab_stack_queue_draw (gpointer data)
+{
+ g_return_val_if_fail (GTK_IS_WIDGET (data), FALSE);
+
+ gtk_widget_queue_draw (GTK_WIDGET (data));
+
+ return G_SOURCE_REMOVE;
+}
+
guint
gb_tab_stack_get_n_tabs (GbTabStack *stack)
{
@@ -176,6 +189,13 @@ gb_tab_stack_remove_tab (GbTabStack *stack,
if (gb_tab_stack_get_tab_iter (stack, tab, &iter))
{
+ g_signal_handlers_disconnect_by_func (tab,
+ gb_tab_stack_tab_closed,
+ stack);
+ g_signal_handlers_disconnect_by_func (tab,
+ gb_tab_stack_queue_draw,
+ stack);
+
gtk_container_remove (GTK_CONTAINER (stack->priv->controls),
gb_tab_get_controls (tab));
gtk_container_remove (GTK_CONTAINER (stack->priv->stack),
@@ -341,16 +361,6 @@ gb_tab_stack_combobox_changed (GbTabStack *stack,
}
}
-static gboolean
-gb_tab_stack_queue_draw (gpointer data)
-{
- g_return_val_if_fail (GTK_IS_WIDGET (data), FALSE);
-
- gtk_widget_queue_draw (GTK_WIDGET (data));
-
- return G_SOURCE_REMOVE;
-}
-
GbTab *
gb_tab_stack_get_active (GbTabStack *stack)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]