From ac01f3b810564f0f7116ae653d0d733963ae4ccf Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Tue, 8 Feb 2005 21:19:57 +0000 Subject: [PATCH] return the active display's shell instead of the toolbox when called from 2005-02-08 Michael Natterer * app/actions/actions.c (action_data_get_widget): return the active display's shell instead of the toolbox when called from the popup. Fall back to the toolbox if there is no active display. Fixes bug #166012. --- ChangeLog | 7 +++++++ app/actions/actions.c | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6926fe1703..31f3724a15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-02-08 Michael Natterer + + * app/actions/actions.c (action_data_get_widget): return the + active display's shell instead of the toolbox when called from the + popup. Fall back to the toolbox if there is no active + display. Fixes bug #166012. + 2005-02-08 Michael Natterer * HACKING: updated info about stable CVS branches of modules we diff --git a/app/actions/actions.c b/app/actions/actions.c index 6038542dd6..0cc0162235 100644 --- a/app/actions/actions.c +++ b/app/actions/actions.c @@ -335,17 +335,22 @@ action_data_get_display (gpointer data) GtkWidget * action_data_get_widget (gpointer data) { + GimpDisplay *display = NULL; + if (! data) return NULL; if (GIMP_IS_DISPLAY (data)) - return ((GimpDisplay *) data)->shell; + display = data; else if (GIMP_IS_GIMP (data)) - return dialogs_get_toolbox (); + display = gimp_context_get_display (gimp_get_user_context (data)); else if (GTK_IS_WIDGET (data)) return data; - return NULL; + if (display) + return display->shell; + + return dialogs_get_toolbox (); } gdouble