diff -uraN gimp.orig/app/tools/gimptransformtool.c gimp/app/tools/gimptransformtool.c
--- gimp.orig/app/tools/gimptransformtool.c	2006-08-11 13:10:14.000000000 -0400
+++ gimp/app/tools/gimptransformtool.c	2006-08-11 13:07:18.000000000 -0400
@@ -61,6 +61,7 @@
 #include "gimptransformoptions.h"
 #include "gimptransformtool.h"
 #include "gimptransformtool-undo.h"
+#include "gimpfliptool.h"
 
 #include "gimp-intl.h"
 
@@ -398,9 +399,37 @@
                                   GimpDisplay     *display)
 {
   GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (tool);
+  GimpTransformOptions *options;
+  GimpItem             *active_item = NULL;
+
+  options = GIMP_TRANSFORM_OPTIONS (tool->tool_info->tool_options);
 
   if (tr_tool->function == TRANSFORM_CREATING)
-    gimp_transform_tool_oper_update (tool, coords, state, TRUE, display);
+    {
+      if (gimp_channel_is_empty (gimp_image_get_mask (display->image))
+          && (tool->tool_info->tool_type != GIMP_TYPE_FLIP_TOOL)
+          && options->type == GIMP_TRANSFORM_TYPE_LAYER 
+          && tr_tool->direction != GIMP_TRANSFORM_BACKWARD)
+        {
+          active_item = (GimpItem *) gimp_image_active_drawable (display->image);
+          if (GIMP_IS_LAYER (active_item) || GIMP_IS_CHANNEL (active_item))
+            {
+              tr_tool->hidden_item = NULL;
+              if (gimp_item_get_visible (active_item))
+                tr_tool->hidden_item = active_item;
+              gimp_item_set_visible (active_item, FALSE, FALSE);
+            }
+          if (GIMP_IS_LAYER_MASK (active_item))
+            {
+              tr_tool->hidden_item = NULL;
+              if (gimp_layer_mask_get_show (active_item))
+                tr_tool->hidden_item = active_item;
+              gimp_layer_mask_set_show (active_item, FALSE, FALSE);
+            }
+          gimp_image_flush (display->image);
+        }
+      gimp_transform_tool_oper_update (tool, coords, state, TRUE, display);
+    }
 
   tr_tool->lastx = tr_tool->startx = coords->x;
   tr_tool->lasty = tr_tool->starty = coords->y;
@@ -1493,14 +1522,18 @@
                               gint               response_id,
                               GimpTransformTool *tr_tool)
 {
+  GimpTransformOptions *options;
+  GimpItem             *active_item = NULL;
+  GimpTool *tool;
+  GimpDisplay *display = GIMP_TOOL (tr_tool)->display;
+
+  tool = GIMP_TOOL (tr_tool);
+
   switch (response_id)
     {
     case RESPONSE_RESET:
       {
-        GimpTool *tool;
-        gint      i;
-
-        tool = GIMP_TOOL (tr_tool);
+         gint      i;
 
         gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
 
@@ -1522,13 +1555,25 @@
       break;
 
     case GTK_RESPONSE_OK:
-      gimp_transform_tool_doit (tr_tool, GIMP_TOOL (tr_tool)->display);
+      gimp_transform_tool_doit (tr_tool, tool->display);
       break;
 
     default:
       gimp_transform_tool_halt (tr_tool);
       break;
     }
+  options = GIMP_TRANSFORM_OPTIONS (tool->tool_info->tool_options);
+  if (options->type == GIMP_TRANSFORM_TYPE_LAYER)
+    {
+      active_item = tr_tool->hidden_item;
+      if (active_item && GIMP_IS_LAYER_MASK (active_item))
+        gimp_layer_mask_set_show (active_item, TRUE, FALSE);
+      else if (active_item && (GIMP_IS_LAYER (active_item) || GIMP_IS_CHANNEL (active_item)))
+        gimp_item_set_visible (active_item, TRUE, FALSE);
+      tr_tool->hidden_item = NULL;
+      if (display)
+        gimp_image_flush (display->image);
+    }
 }
 
 static void
diff -uraN gimp.orig/app/tools/gimptransformtool.h gimp/app/tools/gimptransformtool.h
--- gimp.orig/app/tools/gimptransformtool.h	2006-08-11 13:10:14.000000000 -0400
+++ gimp/app/tools/gimptransformtool.h	2006-08-11 13:15:25.000000000 -0400
@@ -90,6 +90,9 @@
 
   GimpTransformType       type;
   GimpTransformDirection  direction;
+  GimpItem       *hidden_item;   /* If NULL, active item was initially hidden
+                                   * otherwise contains value of active layer, 
+                                   * layer mask, or channel */
 
   const gchar    *undo_desc;
 
