Add and use gimp_dock_columns_new() and add a GimpContext property to
GimpDockColumns. Also move the widget construction from _init() to
_constructor() in GimpDockWindow so we have a context object to pass
to gimp_dock_columns_new().
The image window must not disconnect from the active shell when any
page is removed, only when the active page is removed. This fixes the
bug with this step-by-step:
1. Start GIMP with a clean gimpdir
2. Create two windows
3. Enable single-window mode
4. Disable single-window mode
5. Try to execute a menu action, e.g. Select -> Invert, on both images
Expected result:
It works
Actual result:
It won't work in the image window that was reused and thus once had
two notebook pages, since it disconnected from page 1 when page 2 was
removed.
Also add some debug output.
In order to make a GimpDock get hold of a GimpContext both in
single-window mode and in multi-window mode, don't make it look for a
GimpContext in a GimpDockWindow, put the context in GimpDockColumns
instead. GimpDockColumns exists both in s-w-m and m-w-m, contrary to
GimpDockWindow. Still use the GimpDockWindow as a backup though.
With the introduction of a single-window mode, not only dock windows
needs to be able to create docks, the image window also needs to. So
give it a "dock-factory" property.
We must disconnect from the last display shell when it is removed
when rearranging the UI, so connect to GtkNotebook::page-removed
in GimpImageWindow and do that.
In places where the pattern
if (show)
gtk_widget_show (widget);
else
gtk_widget_hide (widget);
is used, change to
gtk_widget_set_visible (widget, show);
Also do some other minor cleanups.
Keep around a boolean state "is_empty" and update it when adding and
removing shells, and when the image of any shell changes. Do empty
display voodoo only when the "is_empty" state changes.
(gimp_image_window_image_notify): update the ui manager unconditionally
(both when a display is emptied *and* filled)
(gui_display_create): remove updating code here. It was not belonging
here anyway and the image window does the right thing now.
Add a GtkNotebook::switch_page() handler and move all shell switching
code there. In gimp_image_window_set_active_shell(), simply set the
right notebook page.
Which sets/unsets the title of an iconified toplevel image window to
the current progress message (if any). Use the new functions when the
window is (de)iconified. Not exactly the high art of programming, but
much better than the hacks in gimpdisplayshell-progress.c that are now
removed.
This API is most likely not final, but enables adding the vbox of
shell widgets to the image window's vbox *after* the shell constructor
returns. Seems to work nicely :-)
Move the last remaining function to the window. It doesn't actually
belong there, but it's better than the handler in the wrong place.
Added FIXME as reminder.
Don't set the window's active_display manually in gimp_display_shell_new(),
setting it properly after construction in gimp_display_new() works fine
now. Enable all disabled code in gimp_image_window_set_active_display().