Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/metacity/ChangeLog,v
retrieving revision 1.1163
diff -u -p -r1.1163 ChangeLog
--- ChangeLog	11 Feb 2006 05:06:08 -0000	1.1163
+++ ChangeLog	13 Feb 2006 17:53:34 -0000
@@ -1,3 +1,8 @@
+2006-02-13  Thomas Thurman <thomas thurman org uk>
+	* src/keybindings.c (process_tab_grab):
+	Allow alt-escape to cancel alt-tabbing, and vice versa.
+	Fixes #141425.
+
 2006-02-10  Thomas Thurman <thomas thurman org uk>
 
 	Avoid a memory leak when checking which workspace(s) a window is
Index: src/keybindings.c
===================================================================
RCS file: /cvs/gnome/metacity/src/keybindings.c,v
retrieving revision 1.124
diff -u -p -r1.124 keybindings.c
--- src/keybindings.c	12 Feb 2006 03:17:10 -0000	1.124
+++ src/keybindings.c	13 Feb 2006 17:53:34 -0000
@@ -2261,7 +2261,7 @@ process_tab_grab (MetaDisplay *display,
   gboolean popup_not_showing;
   gboolean backward;
   gboolean key_used;
-
+  
   if (screen != display->grab_screen)
     return FALSE;
 
@@ -2317,10 +2317,60 @@ process_tab_grab (MetaDisplay *display,
                                           keysym,
                                           display->grab_mask);
 
-  /* FIXME weird side effect here is that you can use the Escape
-   * key while tabbing, or the tab key while escaping
+  /* Bug 141425: cancel when alt-Escape is pressed during using
+   * alt-Tab, and vice versa.
    */
   
+  switch (action)
+    {
+    case META_KEYBINDING_ACTION_CYCLE_PANELS:
+    case META_KEYBINDING_ACTION_CYCLE_WINDOWS:
+    case META_KEYBINDING_ACTION_CYCLE_PANELS_BACKWARD:
+    case META_KEYBINDING_ACTION_CYCLE_WINDOWS_BACKWARD:
+      /* CYCLE_* are traditionally Escape-based actions,
+       * and should cancel traditionally Tab-based ones.
+       */
+      if (display->grab_op == META_GRAB_OP_KEYBOARD_TABBING_NORMAL ||
+          display->grab_op == META_GRAB_OP_KEYBOARD_TABBING_DOCK)
+        {
+          return FALSE;
+        }
+      break;
+    case META_KEYBINDING_ACTION_SWITCH_PANELS:
+    case META_KEYBINDING_ACTION_SWITCH_WINDOWS:
+    case META_KEYBINDING_ACTION_SWITCH_PANELS_BACKWARD:
+    case META_KEYBINDING_ACTION_SWITCH_WINDOWS_BACKWARD:
+      /* SWITCH_* are traditionally Tab-based actions,
+       * and should cancel traditionally Escape-based ones.
+       */
+      if (display->grab_op == META_GRAB_OP_KEYBOARD_ESCAPING_NORMAL ||
+          display->grab_op == META_GRAB_OP_KEYBOARD_ESCAPING_DOCK)
+        {
+          /* Also, we must re-lower and re-minimize whatever window
+           * we'd previously raised and unminimized.
+           */
+          Window      prev_xwindow;
+          MetaWindow *prev_window;
+          meta_stack_set_positions (screen->stack,
+                                    screen->display->grab_old_window_stacking);
+
+          prev_xwindow =
+                 (Window) meta_ui_tab_popup_get_selected (screen->tab_popup);
+          prev_window =
+                 meta_display_lookup_x_window (display, prev_xwindow);
+
+          if (prev_window && prev_window->tab_unminimized)
+            {
+              meta_window_minimize (prev_window);
+              prev_window->tab_unminimized = FALSE;
+            }
+          return FALSE;
+        }
+      break;
+    default:
+      break;
+    }
+   
   popup_not_showing = FALSE;
   key_used = FALSE;
   backward = FALSE;
