There is now a preference option that determines whether windows
should be opened on the same monitor as before. It should be disabled
when the machine gets monitors plugged/unplugged dynamically ("laptop")
and enabled when there is a static multi-monitor setup ("wokstation").
This is merely the current simplistic policy on top of the newly added
underlying infrastructure:
- pass integer monitor numbers around in all places where we already
pass around a GdkScreen. Pass the "current" monitor to these changed
APIs, where "current" is either the monitor where the action-triggering
widget is, or if that is unavailable the monitor where the mouse is.
- add gimp_widget_get_monitor() in order to easily get to the monitor,
just like gtk_widget_get_screen().
- add screen and monitor parameters in some places that were missed
before.
- in sessionrc, save all window positions relative to the window's
monitor, and save the monitor separately, if it's not the screen's
primary monitor.
- when restoring window positions, use the stored monitor when the new
prefs options says so (use the screen's primary monitor if there is
no stored monitor), otherwise use current monitor that is now passed
around.
This removes the obsolete check which makes the tool fail from
gimp_display_shell_set_mask(). Also change the foreground select tool
and the display mask from using GimpChannel to GeglBuffer, because
that's what it needs, simply buffers. Most changed files simply newly
include <gegl.h> because a GeglBuffer appeared in two headers.
When a new toolbox is opened, don't remove all entries containing a
toolbox from the list of recently closed docks. Instead, check if
there is a toolbox already open when such an entry is chosen and tell
the user to close the existing toolbox first.
in both multi- and single-window mode. This is useful especially in
multi-window mode because in single-window we can already cycle
through all tabs with Ctrl+PageUp/Down.
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.
Add a "hide-docks" config and connect the Windows->Hide docks menu
item to it. Also connect the image window to the config property so it
can hide/show its docks when it needs to.
Also add and use a utility function
gimp_image_window_keep_canvas_pos() to ensure that the image in the
window remains fixed when toggling visiblity of docks. One problem:
When GimpDrawTool is active on the canvas, there is flicker. The end
position is correct though.
Also add regression testing for this fix to test-ui.c
Add Windows→Hide docks menu item. We don't remove the hardcoding of
having Tab trigger it though, because gtk_accelerator_valid() returns
FALSE for GDK_tab. This means that if the user changes keyboard
shortcut for the menu item, both the user shortcut and the hardcoded
shortcut will work. We remove gimp_dialog_factories_toggle() and make
clients activate the action instead to toggle dock visibility.
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.
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.
Change the GimpDialogFactory signals "dock-added" and "dock-removed"
to "dock-window-added" and "dock-window-removed". Doing this makes
sense for a couple of reasons. First of all, the dialog factory is
built around top-levels. Second of all, the listeners to the signals
(such as the "recently closed docks" construct) work on a
gtk-window-level, not a dock level.
This change is a preparation for when GimpDock will stop being a
GimpDockWindow.
2009-01-17 Michael Natterer <mitch@gimp.org>
* all files with a GPL header and all COPYING files:
Change licence to GPLv3 (and to LGPLv3 for libgimp).
Cleaned up some copyright headers and regenerated the parsers in
the ImageMap plugin.
svn path=/trunk/; revision=27913
2008-05-16 Michael Natterer <mitch@gimp.org>
Implement the presistent menu of recently closed docks, still
somewhat hackish but fully functional. Fixes bug #132744.
* app/actions/dialogs-actions.c
* app/actions/dialogs-commands.[ch]
* menus/image-menu.xml.in: remove the menu items that were
creating the hardcoded preconfigured docks.
* app/dialogs/dialogs.[ch]: add GimpContainer of recently closed
docks and API to load and save it.
* app/gui/session.c: call the recent dock load and save functions.
* app/widgets/gimpsessioninfo.[ch]: implement the GimpConfig interface
and (de)serialize via proper interface methods.
* app/gui/session.c
* app/widgets/gimpdialogfactory.c: use the GimpConfig API
to (de)serialize session infos and added the code that was
formerly in the info's (de)serialize functions but didn't belong
there.
* app/widgets/gimpaction.[ch]: add "max-width-chars" property and
set it on proxy menu item labels.
* app/actions/windows-actions.[ch]
* app/actions/windows-commands.[ch]
* app/menus/windows-menu.c: add actions and menu of recently
closed docks and code to restore the dock when the menu items are
selected. Use above new action property to ensure a minimum
width of the menu.
* app/widgets/gimpmenudock.c: use '-' instead of '|' for
separating notebooks in the window title. Menu items don't like '|'.
* app/widgets/gimpdock.c: removed the confirmation dialog when
closing docks and simply add them to the recent docks container.
This code is totally misplaced and will move to another file soon.
svn path=/trunk/; revision=25671
2008-05-11 Michael Natterer <mitch@gimp.org>
* app/actions/windows-commands.[ch]
* app/actions/windows-actions.c
* app/menus/windows-menu.c: add dynamic actions and menu items for
all open docks. Present the dock when the menu item is selected.
svn path=/trunk/; revision=25633
2008-05-10 Michael Natterer <mitch@gimp.org>
Start changing the "Dialogs" menu to "Windows", still incomplete.
Addresses bug #309707.
* app/actions/Makefile.am
* app/actions/windows-actions.[ch]
* app/actions/windows-commands.[ch]: new files which currently
hold the "show toolbox" action and callback and new code which
maintains automatically generated actions for accessing (raising)
all open images.
* app/actions/actions.c: register the new "windows" action group.
* app/actions/dialogs-actions.c
* app/actions/dialogs-commands.[ch]: remove "show toolbox"
action and callback and also the action for the "Disalogs" menu.
* app/menus/Makefile.am
* app/menus/windows-menu.[ch]: new files which create and destroy
the menu items for the image window actions.
* app/menus/menus.c: register the "windows" action group with
all UI managers that have the "dialogs" action group.
* app/menus/image-menu.c (image_menu_setup): call
windows_menu_setup().
* app/gui/gui.c: s/dialogs_show_toolbox/windows_show_toolbox/g
* menus/image-menu.xml.in: some minor s/dialogs/windows/
and add the "Images" submenu.
svn path=/trunk/; revision=25623