[gimp] Bug 688348 - Layer tab and Images tab: not updated on dropping...
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 688348 - Layer tab and Images tab: not updated on dropping...
- Date: Tue, 23 Apr 2013 19:07:35 +0000 (UTC)
commit bacc9c9635776c00ac5603d6d56387073e8a933d
Author: Michael Natterer <mitch gimp org>
Date: Tue Apr 23 21:00:17 2013 +0200
Bug 688348 - Layer tab and Images tab: not updated on dropping...
...one image onto another
gimp_dock_window_display_changed(): make sure the "auto-follow-active"
logic works both ways: when the active image or display is changed in
a dockable, update the global context. Fixes multi-window mode.
gimp_context_real_set_display(): make sure a context's display and
image are always in a consistent state and never have a display that
is not display->image: when display is the same as context->display,
check that the context's image matches display->image, so that after a
gimp_context_set_display(), the context is consistent in all
cases. Fixes single-window mode.
app/core/gimpcontext.c | 20 +++++++++++++++++++-
app/widgets/gimpdockwindow.c | 18 ++++++++++++++++++
2 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/app/core/gimpcontext.c b/app/core/gimpcontext.c
index 3bd0c79..474091e 100644
--- a/app/core/gimpcontext.c
+++ b/app/core/gimpcontext.c
@@ -1929,7 +1929,25 @@ gimp_context_real_set_display (GimpContext *context,
GimpObject *old_display;
if (context->display == display)
- return;
+ {
+ /* make sure that setting a display *always* sets the image
+ * to that display's image, even if the display already
+ * matches
+ */
+ if (display)
+ {
+ GimpImage *image;
+
+ g_object_get (display, "image", &image, NULL);
+
+ gimp_context_real_set_image (context, image);
+
+ if (image)
+ g_object_unref (image);
+ }
+
+ return;
+ }
old_display = context->display;
diff --git a/app/widgets/gimpdockwindow.c b/app/widgets/gimpdockwindow.c
index 9bc6400..f14e5a4 100644
--- a/app/widgets/gimpdockwindow.c
+++ b/app/widgets/gimpdockwindow.c
@@ -973,6 +973,15 @@ gimp_dock_window_display_changed (GimpDockWindow *dock_window,
GimpObject *display,
GimpContext *context)
{
+ /* make sure auto-follow-active works both ways */
+ if (display && dock_window->p->auto_follow_active)
+ {
+ GimpContext *factory_context =
+ gimp_dialog_factory_get_context (dock_window->p->dialog_factory);
+
+ gimp_context_set_display (factory_context, display);
+ }
+
gimp_ui_manager_update (dock_window->p->ui_manager,
display);
}
@@ -985,6 +994,15 @@ gimp_dock_window_image_changed (GimpDockWindow *dock_window,
GimpContainer *image_container = dock_window->p->image_container;
GimpContainer *display_container = dock_window->p->display_container;
+ /* make sure auto-follow-active works both ways */
+ if (image && dock_window->p->auto_follow_active)
+ {
+ GimpContext *factory_context =
+ gimp_dialog_factory_get_context (dock_window->p->dialog_factory);
+
+ gimp_context_set_image (factory_context, image);
+ }
+
if (image == NULL && ! gimp_container_is_empty (image_container))
{
image = GIMP_IMAGE (gimp_container_get_first_child (image_container));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]