Apparently, there was a reason for implementing the window actions

2005-11-27  Michael Natterer  <mitch@gimp.org>

	Apparently, there was a reason for implementing the window actions
	separately for views and docks, fixed the bugs resulting from the
	merge:

	* app/actions/dock-actions.c (dock_actions_update): only update
	the dock actions if the update function is called in the context
	of a dock (not in the context of an image window). Fixes docks
	jumping to other screens on any action on an image window on that
	screen.

	* app/actions/view-actions.c (view_actions_setup): add the window
	actions only to action groups that live in an image window or
	global popup ui manager (not to action groups that belong to a
	dock or dockable). Prevents bugs similar to the one above.
This commit is contained in:
Michael Natterer 2005-11-27 12:16:48 +00:00 committed by Michael Natterer
parent e5f046c33e
commit 6fd3b17609
3 changed files with 42 additions and 4 deletions

View File

@ -1,3 +1,20 @@
2005-11-27 Michael Natterer <mitch@gimp.org>
Apparently, there was a reason for implementing the window actions
separately for views and docks, fixed the bugs resulting from the
merge:
* app/actions/dock-actions.c (dock_actions_update): only update
the dock actions if the update function is called in the context
of a dock (not in the context of an image window). Fixes docks
jumping to other screens on any action on an image window on that
screen.
* app/actions/view-actions.c (view_actions_setup): add the window
actions only to action groups that live in an image window or
global popup ui manager (not to action groups that belong to a
dock or dockable). Prevents bugs similar to the one above.
2005-11-26 Michael Natterer <mitch@gimp.org>
* app/menus/window-menu.c (window_menu_display_opened,closed):

View File

@ -115,7 +115,14 @@ dock_actions_update (GimpActionGroup *group,
SET_VISIBLE ("dock-auto-follow-active", FALSE);
}
window_actions_update (group, toplevel);
if (GIMP_IS_DOCK (toplevel))
{
/* update the window actions only in the context of their
* own window (not in the context of some display or NULL)
* (see view-actions.c)
*/
window_actions_update (group, toplevel);
}
#undef SET_ACTIVE
#undef SET_VISIBLE

View File

@ -457,8 +457,6 @@ view_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (view_scroll_vertical_actions),
G_CALLBACK (view_scroll_vertical_cmd_callback));
window_actions_setup (group, GIMP_HELP_VIEW_CHANGE_SCREEN);
/* connect "activate" of view-zoom-other manually so it can be
* selected even if it's the active item of the radio group
*/
@ -473,6 +471,17 @@ view_actions_setup (GimpActionGroup *group)
group, 0);
view_actions_check_type_notify (GIMP_DISPLAY_CONFIG (group->gimp->config),
NULL, group);
if (GIMP_IS_DISPLAY (group->user_data) ||
GIMP_IS_GIMP (group->user_data))
{
/* add window actions only if the context of the group is
* the display itself or the global popup (not if the context
* is a dock)
* (see dock-actions.c)
*/
window_actions_setup (group, GIMP_HELP_VIEW_CHANGE_SCREEN);
}
}
void
@ -576,7 +585,12 @@ view_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("view-fullscreen", gdisp);
SET_ACTIVE ("view-fullscreen", gdisp && fullscreen);
window_actions_update (group, gdisp ? gdisp->shell : NULL);
if (GIMP_IS_DISPLAY (group->user_data) ||
GIMP_IS_GIMP (group->user_data))
{
/* see view_actions_setup() */
window_actions_update (group, gdisp ? gdisp->shell : NULL);
}
#undef SET_ACTIVE
#undef SET_VISIBLE