Bug 754713 - On-canvas dialog of color picker tool always displays...

...in initially active tab

We intend reuse the dialog across displays, so don't destroy the
dialog in GIMP_TOOL_CONTROL_HALT, only hide it. This way the dialog
keeps its detached state.
This commit is contained in:
Michael Natterer
2015-09-09 01:21:57 +02:00
parent 326ef2f7b2
commit 867b1f7efa

View File

@ -44,6 +44,7 @@
/* local function prototypes */ /* local function prototypes */
static void gimp_color_picker_tool_constructed (GObject *object); static void gimp_color_picker_tool_constructed (GObject *object);
static void gimp_color_picker_tool_dispose (GObject *object);
static void gimp_color_picker_tool_control (GimpTool *tool, static void gimp_color_picker_tool_control (GimpTool *tool,
GimpToolAction action, GimpToolAction action,
@ -110,6 +111,7 @@ gimp_color_picker_tool_class_init (GimpColorPickerToolClass *klass)
GimpColorToolClass *color_tool_class = GIMP_COLOR_TOOL_CLASS (klass); GimpColorToolClass *color_tool_class = GIMP_COLOR_TOOL_CLASS (klass);
object_class->constructed = gimp_color_picker_tool_constructed; object_class->constructed = gimp_color_picker_tool_constructed;
object_class->dispose = gimp_color_picker_tool_dispose;
tool_class->control = gimp_color_picker_tool_control; tool_class->control = gimp_color_picker_tool_control;
tool_class->modifier_key = gimp_color_picker_tool_modifier_key; tool_class->modifier_key = gimp_color_picker_tool_modifier_key;
@ -137,6 +139,24 @@ gimp_color_picker_tool_constructed (GObject *object)
GIMP_COLOR_TOOL_GET_OPTIONS (tool)); GIMP_COLOR_TOOL_GET_OPTIONS (tool));
} }
static void
gimp_color_picker_tool_dispose (GObject *object)
{
GimpColorPickerTool *picker_tool = GIMP_COLOR_PICKER_TOOL (object);
if (picker_tool->gui)
{
g_object_unref (picker_tool->gui);
picker_tool->gui = NULL;
picker_tool->color_area = NULL;
picker_tool->color_frame1 = NULL;
picker_tool->color_frame2 = NULL;
}
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void static void
gimp_color_picker_tool_control (GimpTool *tool, gimp_color_picker_tool_control (GimpTool *tool,
GimpToolAction action, GimpToolAction action,
@ -152,14 +172,7 @@ gimp_color_picker_tool_control (GimpTool *tool,
case GIMP_TOOL_ACTION_HALT: case GIMP_TOOL_ACTION_HALT:
if (picker_tool->gui) if (picker_tool->gui)
{ gimp_tool_gui_hide (picker_tool->gui);
g_object_unref (picker_tool->gui);
picker_tool->gui = NULL;
picker_tool->color_area = NULL;
picker_tool->color_frame1 = NULL;
picker_tool->color_frame2 = NULL;
}
break; break;
case GIMP_TOOL_ACTION_COMMIT: case GIMP_TOOL_ACTION_COMMIT: