--- metacity-2.11.2/src/keybindings.c
+++ metacity-2.11.2/src/keybindings.c
@@ -2407,6 +2407,8 @@
                   XEvent      *event,
                   KeySym       keysym)
 {
+  Window prev_xwindow;
+  MetaWindow *prev_window;
   MetaKeyBindingAction action;
   gboolean popup_not_showing;
   gboolean backward;
@@ -2434,6 +2436,8 @@
       
       if (target_window)
         {
+          target_window->tab_unminimized = 0;
+
           meta_topic (META_DEBUG_KEYBINDINGS,
                       "Activating target window\n");
 
@@ -2501,6 +2505,11 @@
   
   if (key_used)
     {
+      prev_xwindow =
+        (Window) meta_ui_tab_popup_get_selected (screen->tab_popup);
+      prev_window =
+        meta_display_lookup_x_window (display, prev_xwindow);
+
       meta_topic (META_DEBUG_KEYBINDINGS,
                   "Key pressed, moving tab focus in popup\n");
 
@@ -2527,10 +2536,18 @@
             (Window) meta_ui_tab_popup_get_selected (screen->tab_popup);
           target_window =
             meta_display_lookup_x_window (display, target_xwindow);
-          
+
+          if (prev_window && prev_window->tab_unminimized)
+            {
+              prev_window->tab_unminimized = 0;
+              meta_window_minimize (prev_window);
+            }
+
           if (target_window)
             {
               meta_window_raise (target_window);
+              target_window->tab_unminimized = target_window->minimized;
+              meta_window_unminimize (target_window);
             }
         }
     }
@@ -2544,6 +2561,17 @@
                   "Syncing to old stack positions.\n");
       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 = 0;
+        }
     }
   
   return key_used;
--- metacity-2.11.2/src/window.h
+++ metacity-2.11.2/src/window.h
@@ -124,6 +124,7 @@
 
   /* Minimize is the state controlled by the minimize button */
   guint minimized : 1;
+  guint tab_unminimized : 1;
 
   /* Whether the window is mapped; actual server-side state
    * see also unmaps_pending
