[gimp] app: tool control cleanup in GimpCageTool



commit f585788e466fb559f123fcbf5f92ef944e9f6987
Author: Michael Natterer <mitch gimp org>
Date:   Wed Mar 30 11:48:05 2011 +0200

    app: tool control cleanup in GimpCageTool
    
    Don't call tool_control functions twice in init(). Call activate() and
    halt() only on button_press() and button_release() to indicate that
    the tool wants motion events.

 app/tools/gimpcagetool.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/app/tools/gimpcagetool.c b/app/tools/gimpcagetool.c
index c66170f..2e0c9e5 100644
--- a/app/tools/gimpcagetool.c
+++ b/app/tools/gimpcagetool.c
@@ -200,10 +200,6 @@ gimp_cage_tool_init (GimpCageTool *self)
   self->coef_node       = NULL;
   self->cage_node       = NULL;
   self->image_map       = NULL;
-
-  gimp_tool_control_set_wants_click (tool->control, TRUE);
-  gimp_tool_control_set_tool_cursor (tool->control,
-                                     GIMP_TOOL_CURSOR_PERSPECTIVE);
 }
 
 static void
@@ -247,8 +243,6 @@ gimp_cage_tool_start (GimpCageTool *ct,
 
   gimp_cage_tool_halt (ct);
 
-  gimp_tool_control_activate (tool->control);
-
   tool->display = display;
 
   if (ct->config)
@@ -490,6 +484,8 @@ gimp_cage_tool_button_press (GimpTool            *tool,
   if (display != tool->display)
     gimp_cage_tool_start (ct, display);
 
+  gimp_tool_control_activate (tool->control);
+
   if (ct->config)
     handle = gimp_cage_tool_is_on_handle (ct,
                                           draw_tool,
@@ -649,6 +645,8 @@ gimp_cage_tool_button_release (GimpTool              *tool,
 
   gimp_draw_tool_pause (GIMP_DRAW_TOOL (ct));
 
+  gimp_tool_control_halt (tool->control);
+
   if (state & GDK_BUTTON3_MASK)
     {
       /* Cancelling */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]