[gimp] app: Make GimpDockColumns listen to "dock-removed"
- From: Martin Nordholts <martinn src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] app: Make GimpDockColumns listen to "dock-removed"
- Date: Sun, 15 Nov 2009 20:26:24 +0000 (UTC)
commit a6855087135127aa1b1c638a57b292c1c40c50b3
Author: Martin Nordholts <martinn src gnome org>
Date: Sun Nov 15 21:25:28 2009 +0100
app: Make GimpDockColumns listen to "dock-removed"
Make GimpDockColumns listen to "dock-removed", not "dockbook-removed",
when trying to figure out when to destroy itself. Fixes some crashes
when rearranging the UI, for example when doing this step-by-step:
1. Have two dock windows with one dockable each, say A and B
2. Move A to B's dock window and make it multi-column
3. Try to detach B, will result in a crash
app/widgets/gimpdockwindow.c | 29 +++++++++++++----------------
1 files changed, 13 insertions(+), 16 deletions(-)
---
diff --git a/app/widgets/gimpdockwindow.c b/app/widgets/gimpdockwindow.c
index 2bbf2f6..309bb6a 100644
--- a/app/widgets/gimpdockwindow.c
+++ b/app/widgets/gimpdockwindow.c
@@ -110,9 +110,9 @@ static void gimp_dock_window_image_flush (GimpImage *ima
GimpDockWindow *dock_window);
static void gimp_dock_window_update_title (GimpDockWindow *dock_window);
static gboolean gimp_dock_window_update_title_idle (GimpDockWindow *dock_window);
-static void gimp_dock_window_dock_book_removed (GimpDockWindow *dock_window,
- GimpDockbook *dockbook,
- GimpDock *dock);
+static void gimp_dock_window_dock_removed (GimpDockWindow *dock_window,
+ GimpDock *dock,
+ GimpDockColumns *dock_columns);
G_DEFINE_TYPE (GimpDockWindow, gimp_dock_window, GIMP_TYPE_WINDOW)
@@ -208,6 +208,12 @@ gimp_dock_window_init (GimpDockWindow *dock_window)
name = g_strdup_printf ("gimp-dock-%d", dock_window->p->ID);
gtk_widget_set_name (GTK_WIDGET (dock_window), name);
g_free (name);
+
+ /* Destroy the dock window when the last dock is removed */
+ g_signal_connect_object (dock_window->p->dock_columns, "dock-removed",
+ G_CALLBACK (gimp_dock_window_dock_removed),
+ dock_window,
+ G_CONNECT_SWAPPED);
}
static GObject *
@@ -522,13 +528,13 @@ gimp_dock_window_update_title_idle (GimpDockWindow *dock_window)
}
static void
-gimp_dock_window_dock_book_removed (GimpDockWindow *dock_window,
- GimpDockbook *dockbook,
- GimpDock *dock)
+gimp_dock_window_dock_removed (GimpDockWindow *dock_window,
+ GimpDock *dock,
+ GimpDockColumns *dock_columns)
{
g_return_if_fail (GIMP_IS_DOCK (dock));
- if (gimp_dock_get_dockbooks (dock) == NULL &&
+ if (gimp_dock_columns_get_docks (dock_columns) == NULL &&
! dock_window->p->allow_dockbook_absence)
gtk_widget_destroy (GTK_WIDGET (dock_window));
}
@@ -559,12 +565,6 @@ gimp_dock_window_add_dock (GimpDockWindow *dock_window,
g_signal_connect_object (dock, "geometry-invalidated",
G_CALLBACK (gimp_dock_set_host_geometry_hints),
dock_window, 0);
-
- /* Destroy the dock window when the last book is removed */
- g_signal_connect_object (dock, "book-removed",
- G_CALLBACK (gimp_dock_window_dock_book_removed),
- dock_window,
- G_CONNECT_SWAPPED);
}
void
@@ -580,9 +580,6 @@ gimp_dock_window_remove_dock (GimpDockWindow *dock_window,
g_signal_handlers_disconnect_by_func (dock,
gimp_dock_set_host_geometry_hints,
dock_window);
- g_signal_handlers_disconnect_by_func (dock,
- gimp_dock_window_dock_book_removed,
- dock_window);
}
gint
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]