[gimp/gimp-2-8] app: don't call gimp_image_flush() when cancelling GimpImageMapTool



commit 7ef8a96465eea86944df381c88a6c845de5aea2e
Author: Michael Natterer <mitch gimp org>
Date:   Sat May 5 21:42:04 2012 +0200

    app: don't call gimp_image_flush() when cancelling GimpImageMapTool
    
    because the tool might be cancelled from some other place opening an
    undo group, so flushing the image would update menus and whatnot while
    that other operation is running, with unforeseeable side
    effects. Also, flusing the image here is not needed because we didn't
    change anything in the image. Instead, make sure manually that the
    display is updated correctly after restoring GimpImageMapTool's
    temporary editing.
    (cherry picked from commit e7e8c9ef0a7e94413151a4eaffc3824b4ec7467c)

 app/tools/gimpimagemaptool.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/app/tools/gimpimagemaptool.c b/app/tools/gimpimagemaptool.c
index a443823..fd42b6e 100644
--- a/app/tools/gimpimagemaptool.c
+++ b/app/tools/gimpimagemaptool.c
@@ -419,6 +419,8 @@ gimp_image_map_tool_control (GimpTool       *tool,
 
       if (image_map_tool->image_map)
         {
+          GimpImage *image;
+
           gimp_tool_control_set_preserve (tool->control, TRUE);
 
           gimp_image_map_abort (image_map_tool->image_map);
@@ -427,7 +429,19 @@ gimp_image_map_tool_control (GimpTool       *tool,
 
           gimp_tool_control_set_preserve (tool->control, FALSE);
 
-          gimp_image_flush (gimp_display_get_image (tool->display));
+          /* don't call gimp_image_flush() here, because the tool
+           * might be cancelled from some other place opening an undo
+           * group, so flushing the image would update menus and
+           * whatnot while that other operation is running, with
+           * unforeseeable side effects. Also, flusing the image here
+           * is not needed because we didn't change anything in the
+           * image. Instead, make sure manually that the display is
+           * updated correctly after restoring GimpImageMapTool's
+           * temporary editing.
+           */
+          image = gimp_display_get_image (tool->display);
+          gimp_projection_flush_now (gimp_image_get_projection (image));
+          gimp_display_flush_now (tool->display);
         }
 
       tool->drawable = NULL;



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