[gimp] app: fix blend tool behavior across multiple displays
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: fix blend tool behavior across multiple displays
- Date: Sun, 11 Jun 2017 16:18:17 +0000 (UTC)
commit 0eda6b0c9d4942b0a400a44194190d5db2e2132d
Author: Michael Natterer <mitch gimp org>
Date: Sun Jun 11 18:16:47 2017 +0200
app: fix blend tool behavior across multiple displays
Don't update the tool widget when hovering another display at the same
coordinates. Also improve statusbar messages.
app/tools/gimpblendtool.c | 91 ++++++++++++++++++++++++++------------------
1 files changed, 54 insertions(+), 37 deletions(-)
---
diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c
index 8f4a42a..57fc544 100644
--- a/app/tools/gimpblendtool.c
+++ b/app/tools/gimpblendtool.c
@@ -129,8 +129,9 @@ static void gimp_blend_tool_commit (GimpBlendTool *blend_
static void gimp_blend_tool_line_changed (GimpToolWidget *widget,
GimpBlendTool *blend_tool);
-static void gimp_blend_tool_push_status (GimpBlendTool *blend_tool,
+static void gimp_blend_tool_update_status (GimpBlendTool *blend_tool,
GdkModifierType state,
+ gboolean proximity,
GimpDisplay *display);
static void gimp_blend_tool_precalc_shapeburst (GimpBlendTool *blend_tool);
@@ -321,11 +322,12 @@ gimp_blend_tool_oper_update (GimpTool *tool,
{
GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (tool);
- if (blend_tool->line)
- gimp_tool_widget_hover (blend_tool->line, coords, state, proximity);
+ if (display == tool->display && blend_tool->line)
+ {
+ gimp_tool_widget_hover (blend_tool->line, coords, state, proximity);
+ }
- gimp_tool_pop_status (tool, display);
- gimp_blend_tool_push_status (blend_tool, state, display);
+ gimp_blend_tool_update_status (blend_tool, state, proximity, display);
}
static void
@@ -387,10 +389,9 @@ gimp_blend_tool_button_press (GimpTool *tool,
blend_info_new (start_x, start_y, end_x, end_y));
}
- tool->display = display;
gimp_tool_control_activate (tool->control);
- gimp_blend_tool_push_status (blend_tool, state, display);
+ gimp_blend_tool_update_status (blend_tool, state, TRUE, display);
}
static void
@@ -457,10 +458,11 @@ gimp_blend_tool_motion (GimpTool *tool,
GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (tool);
if (blend_tool->grab_widget)
- gimp_tool_widget_motion (blend_tool->grab_widget, coords, time, state);
+ {
+ gimp_tool_widget_motion (blend_tool->grab_widget, coords, time, state);
+ }
- gimp_tool_pop_status (tool, display);
- gimp_blend_tool_push_status (blend_tool, state, display);
+ gimp_blend_tool_update_status (blend_tool, state, TRUE, display);
}
static gboolean
@@ -500,11 +502,12 @@ gimp_blend_tool_active_modifier_key (GimpTool *tool,
GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (tool);
if (blend_tool->grab_widget)
- gimp_tool_widget_motion_modifier (blend_tool->grab_widget,
- key, press, state);
+ {
+ gimp_tool_widget_motion_modifier (blend_tool->grab_widget,
+ key, press, state);
+ }
- gimp_tool_pop_status (tool, display);
- gimp_blend_tool_push_status (blend_tool, state, display);
+ gimp_blend_tool_update_status (blend_tool, state, TRUE, display);
}
static void
@@ -524,7 +527,7 @@ gimp_blend_tool_cursor_update (GimpTool *tool,
{
modifier = GIMP_CURSOR_MODIFIER_BAD;
}
- else if (gimp_blend_tool_is_shapeburst (blend_tool))
+ else if (display != tool->display || ! blend_tool->line)
{
modifier = GIMP_CURSOR_MODIFIER_PLUS;
}
@@ -825,30 +828,44 @@ gimp_blend_tool_line_changed (GimpToolWidget *widget,
}
static void
-gimp_blend_tool_push_status (GimpBlendTool *blend_tool,
- GdkModifierType state,
- GimpDisplay *display)
+gimp_blend_tool_update_status (GimpBlendTool *blend_tool,
+ GdkModifierType state,
+ gboolean proximity,
+ GimpDisplay *display)
{
GimpTool *tool = GIMP_TOOL (blend_tool);
- gchar *status_help;
-
- status_help = gimp_suggest_modifiers ("",
- (gimp_get_constrain_behavior_mask () |
- GDK_MOD1_MASK) &
- ~state,
- NULL,
- _("%s for constrained angles"),
- _("%s to move the whole line"));
-
- gimp_tool_push_status_coords (tool, display,
- gimp_tool_control_get_precision (tool->control),
- _("Blend: "),
- blend_tool->end_x - blend_tool->start_x,
- ", ",
- blend_tool->end_y - blend_tool->start_y,
- status_help);
-
- g_free (status_help);
+
+ gimp_tool_pop_status (tool, display);
+
+ if (proximity)
+ {
+ if (display == tool->display && blend_tool->line)
+ {
+ gchar *status_help =
+ gimp_suggest_modifiers ("",
+ (gimp_get_constrain_behavior_mask () |
+ GDK_MOD1_MASK) &
+ ~state,
+ NULL,
+ _("%s for constrained angles"),
+ _("%s to move the whole line"));
+
+ gimp_tool_push_status_coords (tool, display,
+ gimp_tool_control_get_precision (tool->control),
+ _("Blend: "),
+ blend_tool->end_x - blend_tool->start_x,
+ ", ",
+ blend_tool->end_y - blend_tool->start_y,
+ status_help);
+
+ g_free (status_help);
+ }
+ else
+ {
+ gimp_tool_push_status (tool, display,
+ _("Blend: Click-Drag to draw a gradient"));
+ }
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]