Commit 34e6c873 authored by Ell's avatar Ell
Browse files

app: in GimpDrawTool, avoid CRITICAL on widget signal if not active

In GimpDrawTool, do nothing in the tool-widget signal handlers if
the draw-tool isn't active, to avoid CRITICALs due to a NULL
display.  This can happen if a widget is set before the tool is
started.
parent a9883e98
...@@ -364,13 +364,12 @@ gimp_draw_tool_widget_status (GimpToolWidget *widget, ...@@ -364,13 +364,12 @@ gimp_draw_tool_widget_status (GimpToolWidget *widget,
{ {
GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool); GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
if (status) if (gimp_draw_tool_is_active (draw_tool))
{ {
gimp_tool_replace_status (tool, draw_tool->display, "%s", status); if (status)
} gimp_tool_replace_status (tool, draw_tool->display, "%s", status);
else else
{ gimp_tool_pop_status (tool, draw_tool->display);
gimp_tool_pop_status (tool, draw_tool->display);
} }
} }
...@@ -385,10 +384,14 @@ gimp_draw_tool_widget_status_coords (GimpToolWidget *widget, ...@@ -385,10 +384,14 @@ gimp_draw_tool_widget_status_coords (GimpToolWidget *widget,
{ {
GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool); GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
gimp_tool_pop_status (tool, draw_tool->display); if (gimp_draw_tool_is_active (draw_tool))
gimp_tool_push_status_coords (tool, draw_tool->display, {
gimp_tool_control_get_precision (tool->control), gimp_tool_pop_status (tool, draw_tool->display);
title, x, separator, y, help); gimp_tool_push_status_coords (tool, draw_tool->display,
gimp_tool_control_get_precision (
tool->control),
title, x, separator, y, help);
}
} }
static void static void
...@@ -398,7 +401,8 @@ gimp_draw_tool_widget_message (GimpToolWidget *widget, ...@@ -398,7 +401,8 @@ gimp_draw_tool_widget_message (GimpToolWidget *widget,
{ {
GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool); GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
gimp_tool_message_literal (tool, draw_tool->display, message); if (gimp_draw_tool_is_active (draw_tool))
gimp_tool_message_literal (tool, draw_tool->display, message);
} }
static void static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment