mirror of https://github.com/GNOME/gimp.git
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.
This commit is contained in:
parent
a9883e98e3
commit
34e6c8734b
|
@ -364,12 +364,11 @@ gimp_draw_tool_widget_status (GimpToolWidget *widget,
|
|||
{
|
||||
GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
|
||||
|
||||
if (gimp_draw_tool_is_active (draw_tool))
|
||||
{
|
||||
if (status)
|
||||
{
|
||||
gimp_tool_replace_status (tool, draw_tool->display, "%s", status);
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_tool_pop_status (tool, draw_tool->display);
|
||||
}
|
||||
}
|
||||
|
@ -385,10 +384,14 @@ gimp_draw_tool_widget_status_coords (GimpToolWidget *widget,
|
|||
{
|
||||
GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
|
||||
|
||||
if (gimp_draw_tool_is_active (draw_tool))
|
||||
{
|
||||
gimp_tool_pop_status (tool, draw_tool->display);
|
||||
gimp_tool_push_status_coords (tool, draw_tool->display,
|
||||
gimp_tool_control_get_precision (tool->control),
|
||||
gimp_tool_control_get_precision (
|
||||
tool->control),
|
||||
title, x, separator, y, help);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -398,6 +401,7 @@ gimp_draw_tool_widget_message (GimpToolWidget *widget,
|
|||
{
|
||||
GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
|
||||
|
||||
if (gimp_draw_tool_is_active (draw_tool))
|
||||
gimp_tool_message_literal (tool, draw_tool->display, message);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue