Commit Graph

139 Commits

Author SHA1 Message Date
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
0d2d1c3752 app: port most of app's GUI from stock IDs to icon names
There is still quite some stock ID rendering around, stay tuned...
2014-05-07 15:30:38 +02:00
4202d29347 app: update GimpDisplayShell's monitor resolution when changing monitors
so the image size adapts when dot-for-dot is off.
2014-05-03 17:19:10 +02:00
c7f8ccb4e1 app: make sure image windows end up on the intended monitor
In gimp_image_window_new(), place the window on the right
monitor manually if we are not in single-window-mode.

In gimp_image_window_switch_page(), make sure we don't use an
unrealized new window's monitor for updating the session info, because
the monitor of an unrealized window is always where the pointer is.
2014-05-03 09:40:54 +02:00
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
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
a894f2a689 app: some formatting cleanup in GimpImageWindow 2014-03-13 22:39:03 +01:00
8607486237 app: make sure GimpImageWindow notifies all its shells of monitor changes
Call gimp_color_managed_profile_changed() on all newly added shells,
and on all shells in GimpWindow::monitor_changed().
2014-03-13 22:39:03 +01:00
b2e40c4ca7 Bug 667169 - Single window mode: allow tabs position setting. 2013-10-11 23:16:29 +13:00
4c8399ec0b Bug 701090: reorder the shells too when tabs are reordered.
This allows to not lose the tab order after we come back from multi-window mode.
2013-08-29 18:48:19 +12:00
34a197e304 Bug 701090: allowing to reorder shell tabs by drag'n drop in single-window-mode. 2013-08-29 18:36:13 +12:00
816f651b82 Bug 675436 - Tabs always present when docks shown and absent when docks hidden
The main change is that even with only 1 image in single window mode,
there is now a tab.
Also whatever the number of images when you hide docks with Tab, no tabs
are shown.
2013-07-22 01:19:32 +09:00
de8dc1c96a app: simplify config access in GimpImageWindow
We have a "gimp" member, no need to go via factory->context->gimp.
2013-07-20 15:25:33 +02:00
7e513faa50 Bug 703787 - Crash during switch from multi to single window mode
Shells can now travel from one window to another. Canvas position code
should therefore not keep track of the image window for a specific shell
but must use whatever is the current window for this shell (even though
it may be a different one before and after the size-allocate).
This also partly fixes some positioning issue during mode switch.
2013-07-13 09:15:21 +09:00
112fa53730 Bug 703736: when switching from multi to single window mode, tab order is lost. 2013-07-08 09:34:09 +09:00
a078ca3f5f app: change serialization of the right docks width in SWM (again)
Use "right-docks-width" and always a positive value instead of
"right-docks-position" (as opponsed to "left-docks-width", that
distinction is a GtkPaned implementation detail and does not belong
into a config file). Parse all old values too. Also fix a glitch in
the deserialization code which might fix bug #700147.
2013-05-13 00:00:57 +02:00
6008c2019b Bug 664584: WM DELETE event in single window mode is synonym to file-quit.
In multi-window mode, closing an image window is only meant to close
the current image (unless this is the last empty window).
In single window mode though, you are meaning to close the whole program.

Thanks to Niels Martignène for the original patch.
2013-05-12 04:56:15 +09:00
3972da5256 app: add signal GimpDisplayShell::rotated and use it to update the menu 2013-04-21 03:15:22 +02:00
5880685472 Bug 675549 - image region does not have focus unless clicked on
We cannot simply randomy move the focus from e.g. a text entry back to
the canvas. Instead introduce global handling of "Escape" and a
"primary_focus_widget" that is always set the the image window's
active canvas. When Escape is pressed, move the focus to that primary
focus widget, or beep if it is already there. Text widgets still get
the key events before that logic and can consume the Escape.
2013-04-09 15:41:20 +02:00
0884880579 app: small indentation fix in GimpImageWindow 2013-03-10 19:55:48 +01:00
9da0f489e1 Bug 694665 - SWM should distribute remaining space to main frame
Save the "right-docks-position" as negative value in pixels from the
right window border. Change the image window restoring code to
interpret negative values like that, but keep the meaning of positive
values for compatibility with existing sessionrc files.
2013-02-27 23:46:00 +01:00
a907741d8a Bug 692900 - Dragging left canvas border doesn't respect dock borders
Don't allow the single window's docks to shrink smaller than their
requisition, because that's horribly broken.
2013-02-06 23:27:37 +01:00
d4c72cd5ab Bug 595708 - WM_WINDOW_ROLE should be unique
Make the roles of toolbox, dock and image window unique by adding a
serial number, resulting in e.g. gimp-dock-1.
2012-10-07 18:16:35 +02:00
3084c8be7a Bug 684785 - typo in log message
Apply patch from Okano Takayoshi that fixes the typo.
2012-09-25 22:01:31 +02:00
2c54f4b340 Bug 679256 - SWM image tabs must have a minimum width
Set all tabs to the same width so very narrow images' tabs stay
clickable.
2012-07-09 22:53:17 +02:00
89760cf044 app: Save the maximized state of the main window in the sessionrc file. 2012-05-27 20:42:02 +02:00
c1cfe98d35 Bug 676522 - Changing tabs in single-window-mode should switch the active image
Change the active image when switching tabs in single-window-mode.
2012-05-23 01:25:22 +02:00
fbd746f95a app: don't rely on gtk_container_remove() to always destroy the child
Instead, either destroy the child instead of removing it, or remove
*and* destroy it in cases where the remove() api on the "parent"
doesn't match GTK+'s parent/child relation (like with all our dock
widgets). We can't rely on remove() to implicitly detstroy, because
there might be arbitrary other code holding references, such as
accessibility modules and whatnot. Most likely fixes unclear crashes
in accessibility code and other crashes we blamed GTK+ for.
2012-02-21 00:36:18 +01:00
b3c8cbd5a5 app: remove all docks from GimpImageWindow in dispose()
Seems to fix irregularly occuring warnings on exit about dialogs
being still around.
2012-02-13 00:12:50 +01:00
c2d26d7e03 app: Keep canvas in place when image tabs show/hide 2012-01-04 22:09:07 +02:00
2c175b068d libgimpwidgets: add gtk_paned_new() to gimp3migration.[ch]
and use it all over the place.
2011-10-02 14:36:42 +02:00
3e336199b9 app: use gtk_box_new() 2011-09-30 11:29:11 +02:00
ed00cff9d3 app: don't use image_window->menubar if it's NULL 2011-09-16 23:24:49 +02:00
9cfa0a5dde app: use a smaller icon for the image tabs' close button
Also make sure the visibility of the icon doesn't depend on
GTK+ settings by packing it manually.
2011-09-15 09:04:38 +02:00
a11989542a app: Add a close button to image window tabs
It takes a bit more space, but it needs to be easy to close images.
2011-08-24 23:02:19 +02:00
b9ccf189b4 Bug 650348 - Window unmaximizes when a document is closed
Refactor GimpImageWindow session management. As far as session
management goes, there are four states and four transitions that are
interesting.

The states are:

 State    Window mode     Images opened
 ------------------------------------------
  s1          swm               0
  s2          swm              >0
  s3          mwm               0
  s4          mwm              >0

The transitions are:

  Transition     Description
 -------------------------------------------
      t1         Enter single-window mode (swm)
      t2         Enter multi-window mwm (mwm)
      t3         Open an image
      t4         Close an image

When thinking of it like this, it is pretty easy to see when to call
gimp_image_window_session_clear() and when to call
gimp_image_window_session_apply(). So kill
gimp_image_window_set_entry_id() and handle all transitions in
gimp_image_window_session_update().
2011-08-09 20:25:06 +02:00
3ce4c49314 app: Handle special case "Toolbox" in GimpSingleWindowStrategy
The special case isn't pretty, but the current design can't handle it
nicely. This is not the first special case for the toolbox.
2011-07-20 16:36:36 +02:00
07556242b0 app: Make positioning of new dockables depend on window mode
Add GimpWindowingStrategy with create_dockable_dialog() and use it in
dialogs_create_dockable_cmd_callback(). There are two implementations:
GimpSingleWindowStrategy and GimpMultiWindowStrategy. Depending on the
window mode, we want new dockables to appear in different places when
created. In single-window mode, they should appear inside the single
image window. In multi-window mode, a new dock window is created.
2011-07-03 21:20:36 +02:00
bb39703c7a app: Update appearance after adding dock
Since gimp_display_shell_appearance_update() depends on docks being
present, call it in gimp_image_window_add_dock(). Otherwise the resize
handle will be present when starting in single-window mode.
2011-06-06 16:07:25 +02:00
42c2c747d8 Bug 603848 - Single-window mode is not properly session managed yet
Make GimpImageWindow implement GimpDockContainer and
GimpSessionManaged so that GIMP can be started in single-window mode.
2011-06-04 12:22:20 +02:00
75259bf4bb app: Call gimp_image_window_session_update() early
Call gimp_image_window_session_update() at the end of
gimp_image_window_constructed() so that if GIMP is closed right after
being started, the image window session info has the widget
initialized (and also so that the correct size is setup initially).
2011-06-04 12:22:20 +02:00
1ebd2b5113 Revert "app: Make alt+[number] switch tabs in single-window mode"
This reverts commit 110b3daa97.
2011-05-07 23:54:54 +02:00
c35ff719a7 app/libgimp*: remove stuff found by -Wunused-but-set-variable 2011-05-01 23:23:19 +02:00
5c55f8e897 app: Fix Alt+0 case when switching tabs 2011-04-06 11:58:58 +05:30
110b3daa97 app: Make alt+[number] switch tabs in single-window mode 2011-04-06 11:52:10 +05:30
166c76b62d Bug 630069 - In single-window mode, canvas badly positioned in all successive tabs
The problem is that gimp_image_window_keep_canvas_pos() connects a
signal handler too early, with data not yet valid, the handler is
executed after the canvas position is computed correctly and so
invalid data overrides the valid.

Checks the return value of gtk_widget_translate_coordinates() to avoid
connecting handlers when their execution is considered harmful.
2011-03-09 07:34:27 +01:00
145db8d57c Bug 639305 - Image tabs pushes toolbox to left
Set the notebook to scrollable. Not a final fix, but enough to fix the
immediate problem.
2011-03-01 00:56:23 +01:00
c09ad998a4 app: split tool event handling out into an own file
it was simply getting too hairy in the callbacks.c file.
2011-02-24 02:15:53 +01:00
bbe0e757b8 app: some GimpImageWindow cleanup
- implement GObject::constructed() instead of ::construct()
- remove the display pause/resume idle hack because any tool
  drawing flickering is gone now by using cairo
- some formatting cleanup
- remove some unused local variables
2010-11-26 09:19:36 +01:00
0e17e44ba4 app: move code from GtkObject::destroy() to GObject::dispose() 2010-09-26 22:35:49 +02:00