Fix behavior so that when Alt is down, it appears as if no other modifier

2006-11-11  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimpselectiontool.c
	(gimp_selection_tool_modifier_key): Fix behavior so that when Alt
	is down, it appears as if no other modifier was pressed.
	Fixes bug #349338.
This commit is contained in:
Michael Natterer 2006-11-11 10:44:02 +00:00 committed by Michael Natterer
parent dc2d31c9d7
commit cb6fe48ccd
2 changed files with 40 additions and 29 deletions

View File

@ -1,3 +1,10 @@
2006-11-11 Michael Natterer <mitch@gimp.org>
* app/tools/gimpselectiontool.c
(gimp_selection_tool_modifier_key): Fix behavior so that when Alt
is down, it appears as if no other modifier was pressed.
Fixes bug #349338.
2006-11-09 Kevin Cozens <kcozens@cvs.gnome.org>
* plug-ins/script-fu/scheme-wrapper.c (marshall_proc_db_call): Use

View File

@ -124,43 +124,47 @@ gimp_selection_tool_modifier_key (GimpTool *tool,
{
GimpChannelOps button_op = options->operation;
if (state & GDK_MOD1_MASK)
if (press)
{
button_op = selection_tool->saved_operation;
if (key == (state & (GDK_SHIFT_MASK |
GDK_CONTROL_MASK |
GDK_MOD1_MASK)))
{
/* first modifier pressed */
selection_tool->saved_operation = options->operation;
}
}
else
{
if (press)
if (! (state & (GDK_SHIFT_MASK |
GDK_CONTROL_MASK |
GDK_MOD1_MASK)))
{
if (key == (state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)))
{
/* first modifier pressed */
/* last modifier released */
selection_tool->saved_operation = options->operation;
}
button_op = selection_tool->saved_operation;
}
else
{
if (! (state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)))
{
/* last modifier released */
}
button_op = selection_tool->saved_operation;
}
}
if ((state & GDK_CONTROL_MASK) && (state & GDK_SHIFT_MASK))
{
button_op = GIMP_CHANNEL_OP_INTERSECT;
}
else if (state & GDK_SHIFT_MASK)
{
button_op = GIMP_CHANNEL_OP_ADD;
}
else if (state & GDK_CONTROL_MASK)
{
button_op = GIMP_CHANNEL_OP_SUBTRACT;
}
if (state & GDK_MOD1_MASK)
{
/* if alt is down, pretend that neither
* shift nor control are down
*/
button_op = selection_tool->saved_operation;
}
else if ((state & GDK_CONTROL_MASK) && (state & GDK_SHIFT_MASK))
{
button_op = GIMP_CHANNEL_OP_INTERSECT;
}
else if (state & GDK_SHIFT_MASK)
{
button_op = GIMP_CHANNEL_OP_ADD;
}
else if (state & GDK_CONTROL_MASK)
{
button_op = GIMP_CHANNEL_OP_SUBTRACT;
}
if (button_op != options->operation)