[gimp] app: Destory the dock window from the dock window, not the dock
- From: Martin Nordholts <martinn src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] app: Destory the dock window from the dock window, not the dock
- Date: Sat, 26 Sep 2009 14:22:54 +0000 (UTC)
commit 12a0ea10635cb1f267470a36e523a698cd4c2dc2
Author: Martin Nordholts <martinn src gnome org>
Date: Sat Sep 26 15:24:05 2009 +0200
app: Destory the dock window from the dock window, not the dock
app/widgets/gimpdock.c | 2 --
app/widgets/gimpdockwindow.c | 20 ++++++++++++++++++++
2 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/app/widgets/gimpdock.c b/app/widgets/gimpdock.c
index 77a90f6..1ca1392 100644
--- a/app/widgets/gimpdock.c
+++ b/app/widgets/gimpdock.c
@@ -288,8 +288,6 @@ static void
gimp_dock_real_book_removed (GimpDock *dock,
GimpDockbook *dockbook)
{
- if (dock->p->dockbooks == NULL)
- gtk_widget_destroy (GTK_WIDGET (dock));
}
diff --git a/app/widgets/gimpdockwindow.c b/app/widgets/gimpdockwindow.c
index 279330b..99fe4ee 100644
--- a/app/widgets/gimpdockwindow.c
+++ b/app/widgets/gimpdockwindow.c
@@ -104,6 +104,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);
G_DEFINE_TYPE (GimpDockWindow, gimp_dock_window, GIMP_TYPE_WINDOW)
@@ -251,6 +254,12 @@ gimp_dock_window_constructor (GType type,
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);
+
/* Done! */
return object;
}
@@ -502,6 +511,17 @@ gimp_dock_window_update_title_idle (GimpDockWindow *dock_window)
return FALSE;
}
+static void
+gimp_dock_window_dock_book_removed (GimpDockWindow *dock_window,
+ GimpDockbook *dockbook,
+ GimpDock *dock)
+{
+ g_return_if_fail (GIMP_IS_DOCK (dock));
+
+ if (gimp_dock_get_dockbooks (dock) == NULL)
+ gtk_widget_destroy (GTK_WIDGET (dock_window));
+}
+
gint
gimp_dock_window_get_id (GimpDockWindow *dock_window)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]