which would have been the correct oder all the time, because these
systems are initialized in reverse order. The wrong order didn't
matter until now, but for some reason it now sometimes triggered
warnings about dialog_factories being NULL during controllers
shutdown.
We need to be able to pass a GimpUIManager to
gimp_dialog_factory_dialog_new(), so make that possible. Also make
sure to set ui_manager in gimp_dialog_factory_dialog_new_internal()
when we create both a dock window and a dock, so tooltips works in
toolboxes created from scratch.
Move toolbox special casing into
gimp_dialog_factory_dialog_new_internal() and on the fly fix problems
with double toolboxes appearing and sometimes not appearing.
Instead of including dialogs/dialogs.h everywhere, introduce
gimp_dialog_factory_get_singleton(). The dialog factory singleton is
still initialized by dialogs.c though.
Right now the assumption is that we never will have another dialog
factory instance around. There were so many problems before when we
had four of them, so let's just keep one of them around.
We only have one dialog factory now, and
gimp_dialog_factory_from_name() doesn't provide compile-time type
safety, so use global_dialog_factory directly instead.
Update image window side docks visiblity from the image window itself
instead of from the ui configurer. The image window has a dependency
to the config object anyway, so no need to complicate things.
Get rid of 'global_toolbox_factory' and manage everything dock-related
with 'global_dock_factory'. The whole of 'global_toolbox_factory' was
a big special-case and getting rid of it makes it easier to extend the
session management with e.g. single-window mode dock functionality.
To get rid of 'global_toolbox_factory' we, roughly, have to
* Replace 'global_toolbox_factory' with 'global_dock_factory'
everywhere. We can also get rid of lots of code that did special
things for the "toolbox" factory.
* Make the use or interaction with the toolbox explicit in some
places. For example, a function gimp_dock_window_has_toolbox() has
been introduced.
* Make GimpSessionInfoDock have an 'identifier' parameter so we can
differentiate between the "gimp-dock" and "gimp-toolbox" dock
types.
Rename back global_dock_window_factory to
global_dock_factory. Renaming to global_dock_window_factory was done
under the assumption that there would be a separate factory that would
create non-toplevel dockables, but I don't expect this to happen in
the forseeable future.
Let dock windows have proper GimpDialogFactory entries. This allows us
to get rid of a lot of ugly mostly duplicated code. This also makes us
ready the merge the dock window and toolbox factories which will soon
be done. A few things should be noted:
* We adjust the wrap box aspect ratio in the toolbox to avoid having
the toolbox dock window explode
* We make sure that we still can handle sessionrc files from GIMP 2.6
and older
Check for dirty images before forcing single-window mode since it is
annoying to have the UI split up and _then_ being asked about unsaved
images. The user might even click 'Cancel' in which case the UI will
have been switched to multi-window mode.
In order to prevent people from losing dockable dialogs, force
multi-window mode on exit. This is a workaround until single-window
mode is session managed.
This idea comes from some guy in the IRC channel who I unfortunately
forgot the name of and fail to find in the logs.
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.
Move g_list_copy() out from gimp_dock_columns_get_docks(). Fixes at
least one memory leak (in gimp_dock_window_get_dock()) and feels nicer
and more flexible.
Enable repeated toggling between Multi- an Single-window mode. When
enabling Single-window mode all docks and displays are put in a single
window. When disabling Single-window mode they are moved out to their
own windows again.
Rename gimp_get_image_window_iter() to gimp_get_image_windows() and
make it return a copy of the list of windows. Typically we will kill
or create new windows when we use this function which is why we do a
copy.
Since we added a GimpDockColumns to GimpDockWindows we need to use
gimp_dock_window_remove_dock() not gtk_container_remove(). This makes
"Windows→Single-window mode" work as before again.
When 'Single-window mode is enabled, move the toolbox and existing
docks into the image window. Needs a lot of more work but is
functional enough for curious people.
Implemented by adding a new GimpUIConfigurer component that has global
knowledge. There is a single application instance of this
component. It subscribes to changes in the single-window-mode config
property and adjusts the UI accordingly.
(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.
The new function does the right thing, unlike get_toplevel() which
returns the shell itself if it is not in a window. Check the return
value of get_window() for being non-NULL.
Also move some of their related code and update other code to
go via gtk_widget_get_toplevel(), but also add some horrid temp
/* FIXME image window */ hacks.