[gimp] app: fix modifiers being stuck in transform tools
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: fix modifiers being stuck in transform tools
- Date: Wed, 10 Jan 2018 01:39:28 +0000 (UTC)
commit 1d2c015dcf2f9e8d6c8bae2b8d5a786ddc40f4a8
Author: Michael Natterer <mitch gimp org>
Date: Wed Jan 10 02:30:09 2018 +0100
app: fix modifiers being stuck in transform tools
When the active modifier mode is GIMP_TOOL_ACTIVE_MODIFIERS_SAME (the
tool does not want to distinguish between modifier states depending
on whether or not the first mouse button down), we need to make sure
these states are in sync in GimpTool's bookkeeping, and we must not
generate synthetic modifier releases when the mouse button is
released.
app/tools/gimptool.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/app/tools/gimptool.c b/app/tools/gimptool.c
index ceed324..7e8e2db 100644
--- a/app/tools/gimptool.c
+++ b/app/tools/gimptool.c
@@ -822,7 +822,9 @@ gimp_tool_button_release (GimpTool *tool,
g_warn_if_fail (gimp_tool_control_is_active (tool->control) == FALSE);
- if (tool->active_modifier_state != 0)
+ if (tool->active_modifier_state != 0 &&
+ gimp_tool_control_get_active_modifiers (tool->control) !=
+ GIMP_TOOL_ACTIVE_MODIFIERS_SAME)
{
gimp_tool_control_activate (tool->control);
@@ -831,7 +833,8 @@ gimp_tool_button_release (GimpTool *tool,
gimp_tool_control_halt (tool->control);
}
- tool->button_press_state = 0;
+ tool->button_press_state = 0;
+ tool->active_modifier_state = 0;
g_object_unref (tool);
}
@@ -1161,6 +1164,9 @@ gimp_tool_set_active_modifier_state (GimpTool *tool,
}
tool->active_modifier_state = state;
+
+ if (active_modifiers == GIMP_TOOL_ACTIVE_MODIFIERS_SAME)
+ tool->modifier_state = state;
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]