RSS/Atom feed Twitter
Site is read-only, email is disabled

Dockables aren't disposed when closing floating dock window

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

Dockables aren't disposed when closing floating dock window P S 12 Aug 22:11
  Dockables aren't disposed when closing floating dock window Martin Nordholts 13 Aug 09:00
P S
2011-08-12 22:11:29 UTC (over 13 years ago)

Dockables aren't disposed when closing floating dock window

This is my first post in gimp-dev so forgive me if I happen to miss out context or interfere with current work in progress.

It turns out dockables aren't disposed after a gimp_dock_dispose() call in the current master. gimp_dock_dispose() only removes dockbooks which will not be disposed if references are still held by attached dockables.

The behavior is particularly notable on singleton dockables when closing a floating dock window:
1. Add a new tab Tool Options to main dock 2. Drag out or detach Tool Options tab to a floating dock window 3. Close the floating dock window
4. Try to re-insert Tool Options tab in main dock. Doesn't work - as floating dock's dockbook hasn't been disposed and Tool Options dockable is still attached to it

I took a chance and came up with the following workaround by explicitly removing all dockables from a dockbook upon gimp_dock_dispose() call:

diff --git a/app/widgets/gimpdock.c b/app/widgets/gimpdock.c index ccdeac1..c27aceb 100644
--- a/app/widgets/gimpdock.c
+++ b/app/widgets/gimpdock.c
@@ -199,9 +199,14 @@ static void
gimp_dock_dispose (GObject *object) {
GimpDock *dock = GIMP_DOCK (object); + GimpDockbook *dockbook = NULL;

while (dock->p->dockbooks) - gimp_dock_remove_book (dock, GIMP_DOCKBOOK (dock->p->dockbooks->data)); + {
+ dockbook = GIMP_DOCKBOOK (dock->p->dockbooks->data); + gimp_dock_remove_book (dock, dockbook); + gimp_dockbook_remove_all (dockbook); + }

G_OBJECT_CLASS (parent_class)->dispose (object); }
diff --git a/app/widgets/gimpdockbook.c b/app/widgets/gimpdockbook.c index bf47c16..3e7f267 100644
--- a/app/widgets/gimpdockbook.c
+++ b/app/widgets/gimpdockbook.c
@@ -1081,6 +1081,14 @@ gimp_dockbook_remove (GimpDockbook *dockbook, }
}

+void
+gimp_dockbook_remove_all (GimpDockbook *dockbook) +{
+ g_return_if_fail (GIMP_IS_DOCKBOOK (dockbook)); +
+ while (dockbook->p->dockables)
+ gimp_dockbook_remove(dockbook,
GIMP_DOCKABLE(dockbook->p->dockables->data)); +}
/**
* gimp_dockbook_update_with_context: * @dockbook:
diff --git a/app/widgets/gimpdockbook.h b/app/widgets/gimpdockbook.h index 2af7b40..434495a 100644
--- a/app/widgets/gimpdockbook.h
+++ b/app/widgets/gimpdockbook.h
@@ -73,6 +73,7 @@ GtkWidget *
gimp_dockbook_add_from_dialog_factory (GimpDockbook *dockbo gint position);
void gimp_dockbook_remove (GimpDockbook *dockbook,
GimpDockable *dockable);
+void gimp_dockbook_remove_all (GimpDockbook *dockbook);
void gimp_dockbook_update_with_context (GimpDockbook *dockbook,
GimpContext *context);
GtkWidget * gimp_dockbook_create_tab_widget (GimpDockbook *dockbook,

Martin Nordholts
2011-08-13 09:00:57 UTC (over 13 years ago)

Dockables aren't disposed when closing floating dock window

2011/8/13 P S :

This is my first post in gimp-dev so forgive me if I happen to miss out context or interfere with current work in progress.

It turns out dockables aren't disposed after a gimp_dock_dispose() call in the current master. gimp_dock_dispose() only removes dockbooks which will not be disposed if references are still held by attached dockables.

The behavior is particularly notable on singleton dockables when closing a floating dock window:
1. Add a new tab Tool Options to main dock 2. Drag out or detach Tool Options tab to a floating dock window 3. Close the floating dock window
4. Try to re-insert Tool Options tab in main dock. Doesn't work - as floating dock's dockbook hasn't been disposed and Tool Options dockable is still attached to it

You don't happen to be running Ubuntu 11.04 are you? Their GTK+ installation seems to be broken. Try building GTK+ yourself, preferably GTK+ 2.24.5 and see if the problem goes away.

BR, Martin