Commit bacc9c96 authored by Michael Natterer's avatar Michael Natterer 😴

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.
parent 076f375e
......@@ -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;
......
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment