Commit Graph

42 Commits

Author SHA1 Message Date
Michael Natterer a3c65e6d17 app: get rid of including menus/ stuff from widgets/ and other places
Add GimpMenuFactory can always be found in a GimpDialogManager, use
gimp_dialog_factory_get_menu_factory() where we have a dialog factory
instead of accessing "global_menu_factory" or redundantly passing a
menu factory around where we already pass around a dialog factory.
2016-11-23 19:38:44 +01:00
Michael Natterer bbf01ebabf libgimpwidgets, app: add gdk_screen_get_monitor_workarea()
to the gimp3migration hack and use it where appropriate, so in the
gtk3-port branch windows will not overlap with docks, panels etc.
2014-05-19 14:37:32 +02:00
Michael Natterer 4bb63322d7 app: keep docks on the monitor in gimp_ui_configurer_move_docks_to_window()
and don't move them to the very left and right of the screen, which might
be on different monitors. Also clean up the function.
2014-05-02 21:16:17 +02:00
Michael Natterer 7f23fbec34 app: add screen and monitor to all display and image window constructors
so they appear on the proper monitor as well.
2014-05-02 20:21:41 +02:00
Michael Natterer 843866e7e7 app: make things behave more reasonable with multiple monitors
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.
2014-05-02 03:01:23 +02:00
Jehan 8ef5fca062 app - call to keep the active shell in single window mode switch out of loop.
Small fix from commit 2697b29. This previous commit was working well, but
implied calling this method as many time as there are opened shells,
whereas once is enough.
2013-07-08 21:24:50 +09:00
Jehan 2697b29963 Bug 703738: when switching between multi and single window mode, keep the same active shell. 2013-07-07 23:52:38 +09:00
Ville Skyttä 6b0d1038cc Bug 692641 - Various spelling fixes 2013-01-27 18:59:02 +01:00
Michael Natterer 867da8f293 app: add gimp_context_get_foreground,background_pixel()
which takes a Babl format to convert from/to.
Include <gegl.h> in a million places.
2012-05-02 17:50:41 +02:00
Michael Natterer 2414301799 Review the last few commits and apply some style fanaticism
some completely unrelated,
2012-02-07 20:36:55 +01:00
Massimo Valentini 39368a410d plugged memory leaks 2012-02-07 17:32:02 +01:00
Martin Nordholts 875471d6bd app: Don't create empty dock windows when switching off swm 2011-08-05 01:51:56 +02:00
Martin Nordholts 4080caf999 app: Handle docks more clever when switching on swm
When switching on single-window mode, put docks in the image window
depending on what side of the window they originally had.
2011-08-05 01:51:56 +02:00
Martin Nordholts 143a04b2d0 app: Keep original GimpDockColumns size when moving out to a dock window
When moving out GimpDock:s from a GimpDockColumns into a new
GimpDockWindow when switching off single-window mode, try to preserve
the size of the original GimpDockColumns.
2011-08-04 21:42:43 +02:00
Martin Nordholts 1ab5c31145 app: Fix copy paste error in gimp_ui_configurer_move_docks_to_window() 2011-08-04 21:01:01 +02:00
Martin Nordholts a836c0f2c9 app: Distribute dock windows better when switching off swm
Distribute dock windows better when switching off single-window
mode. First, create one dock window per side of the image window
rather than one dock window per dock. Secondly, move the left docks to
the upper left corner of the screen, and the right docks to the upper
right corner.
2011-07-21 00:00:18 +02:00
Massimo Valentini fe6e0c1913 Bug 646794 - Get rid of valgrind warnings when changing window mode 2011-06-17 17:52:39 +02:00
Martin Nordholts 0f19471e22 app: Make GimpDockContainer::get_docks() return a new list
Make GimpDockContainer::get_docks() return a new list and not just a
pointer to a list so that GimpImageWindow can implement it (who needs
to merge its two GimpDockColumns lists).
2011-05-13 21:04:23 +02:00
Martin Nordholts 4b9243fc60 app: Make GimpDockWindow implement GimpDockContainer
Make GimpDockWindow implement the GimpDockContainer interface. The
plan is to make GimpImageWindow also implement the GimpDockContainer
interface when we start to session manage docks in single-window mode.
2011-05-09 19:55:51 +02:00
Michael Natterer e91890f659 app: always use the first display's image window as single-window
so the tabs are in the order of the global display list which is the
order of the image menu items and their ALT+number shortcuts.
2011-05-08 21:41:06 +02:00
Michael Natterer 54d33500d8 app: move updating the shells' appearance to a utility function
and call that after the UI is reconfigured, instead of having that
code spread across the entire file.
2010-11-28 13:35:09 +01:00
Michael Natterer ffcbe2c165 Bug 622311 - Get rid of status bar grip window in single-window mode
The the presence of docks in the image window into account when
deciding whether to show the statusbar resize grip, and simply call
gimp_display_shell_appearance_update() on all shells when
reconfiguring the UI for single-window-mode (which feels like the
right thing to do anyway).
2010-11-28 13:19:06 +01:00
Martin Nordholts d7dc2dc1ab app: Make tooltips in the toolbox work again
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.
2010-05-16 12:19:18 +02:00
Martin Nordholts 11b1300b6f app: Introduce gimp_dialog_factory_get_singleton()
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.
2010-02-28 23:23:24 +01:00
Martin Nordholts 82a0b95147 app: Update image window side docks visiblity from the image window
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.
2010-02-24 19:53:48 +01:00
Martin Nordholts bf830398a5 app: Cleanup GimpImageWindow and dependencies, only one dialog factory
Cleanup GimpImageWindow and dependencies like GimpDisplay, there is
only one dialog factory now.
2010-02-20 11:09:51 +01:00
Martin Nordholts c3619fb85c app: Merge "toplevel" and "display" factories
Merge "toplevel" and "display" factories so that we only have one
dialog factory. This allows us to get rid of a lot of special casing.
2010-02-20 10:58:29 +01:00
Martin Nordholts 8b458fb591 app: Merge "toplevel" and "dock" dialog factories
Merge "toplevel" and "dock" dialog factories. The end goal is to have
only one dialog factory.
2010-02-20 09:28:26 +01:00
Martin Nordholts 1093462ae9 app: Merge 'global_toolbox_factory' into 'global_dock_factory'
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.
2010-01-20 18:29:54 +01:00
Martin Nordholts 66197c5d11 app: global_dock_window_factory -> global_dock_factory
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.
2010-01-19 22:40:06 +01:00
Martin Nordholts 56a8cb68a8 app: Have dialog factory entries for the dock windows
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
2010-01-19 22:24:17 +01:00
Martin Nordholts 90d7ffde1a app: Make all GimpDialogFactory members private
Add necessary trivial API that allows us to make remaining
GimpDialogFactory instance members private, and make them private.
2009-12-20 20:21:26 +01:00
Martin Nordholts 8699511bbd app: global_dock_window_factory -> global_dock_factory
With GimpDock not being a toplevel any longer, it makes more sense to
name global_dock_factory global_dock_window_factory. Do that.
2009-12-20 14:41:02 +01:00
Martin Nordholts f3235e6f45 app: Add "dock-factory" property to GimpImageWindow
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.
2009-12-08 19:49:13 +01:00
Martin Nordholts b1b560b0c4 app: Only kill living dock windows when switching to s-w-m
Only kill living dock windows when switching to single-window
mode. When we remove the last dock in a non-toolbox dock window, it
will commit suicide.
2009-12-06 09:50:02 +01:00
Martin Nordholts 13bac61020 app: Move g_list_copy() out from gimp_dock_columns_get_docks()
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.
2009-11-15 19:21:57 +01:00
Martin Nordholts 521543106c app: Enable repeated toggling between Multi- and Single-window mode
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.
2009-10-25 22:05:57 +01:00
Martin Nordholts d7c61bade9 app: Copy dialogs list so we can remove while we iterate 2009-10-25 20:35:49 +01:00
Martin Nordholts ca5fbf45d4 app: gimp_get_image_window_iter() -> gimp_get_image_windows()
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.
2009-10-25 20:31:55 +01:00
Martin Nordholts 39ee4ffa43 app: Use gimp_dock_window_remove_dock() not gtk_container_remove()
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.
2009-10-25 20:27:28 +01:00
Martin Nordholts 6f95bc6888 app: Keep GimpDocks in GtkPaneds in GimpDockColumns
Use the new GimpPanedBox to make the space for GimpDocks in
GimpDockColumns manually distributable by the use of GtkPaneds.
2009-10-24 20:10:42 +02:00
Martin Nordholts fcf5895575 app: Move docks to image window in 'Single-window mode'
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.
2009-10-04 02:10:11 +02:00