Index: src/terminal-screen.c
===================================================================
--- src/terminal-screen.c	(revision 3202)
+++ src/terminal-screen.c	(working copy)
@@ -80,6 +80,8 @@
   SHOW_POPUP_MENU,
   MATCH_CLICKED,
   CLOSE_SCREEN,
+  HIGHLIGHT_SCREEN,
+  UNHIGHLIGHT_SCREEN,
   LAST_SIGNAL
 };
 
@@ -107,6 +109,8 @@
 static void terminal_screen_class_init  (TerminalScreenClass *klass);
 static void terminal_screen_dispose     (GObject             *object);
 static void terminal_screen_finalize    (GObject             *object);
+static void terminal_screen_beep_cb            (TerminalScreen      *screen);
+static gboolean terminal_screen_focus_cb       (TerminalScreen      *screen);
 static void terminal_screen_drag_data_received (GtkWidget        *widget,
                                                 GdkDragContext   *context,
                                                 gint              x,
@@ -397,6 +401,10 @@
 
   g_signal_connect (screen, "parent-set", G_CALLBACK (parent_set_callback), NULL);
 
+  g_signal_connect (screen, "beep", G_CALLBACK (terminal_screen_beep_cb), NULL);
+  g_signal_connect (screen, "focus", G_CALLBACK (terminal_screen_focus_cb), NULL);
+  g_signal_connect (screen, "focus-in-event", G_CALLBACK (terminal_screen_focus_cb), NULL);
+
 #ifdef DEBUG_GEOMETRY
   g_signal_connect_after (screen, "size-request", G_CALLBACK (size_request), NULL);
   g_signal_connect_after (screen, "size-allocate", G_CALLBACK (size_allocate), NULL);
@@ -534,6 +542,26 @@
                   G_TYPE_NONE,
                   0);
 
+  signals[HIGHLIGHT_SCREEN] =
+    g_signal_new (I_("highlight-screen"),
+                  G_OBJECT_CLASS_TYPE (object_class),
+		  G_SIGNAL_RUN_LAST,
+		  G_STRUCT_OFFSET (TerminalScreenClass, highlight_screen),
+		  NULL, NULL,
+		  g_cclosure_marshal_VOID__VOID,
+		  G_TYPE_NONE,
+		  0);
+
+  signals[UNHIGHLIGHT_SCREEN] =
+    g_signal_new (I_("unhighlight-screen"),
+                  G_OBJECT_CLASS_TYPE (object_class),
+		  G_SIGNAL_RUN_LAST,
+		  G_STRUCT_OFFSET (TerminalScreenClass, unhighlight_screen),
+		  NULL, NULL,
+		  g_cclosure_marshal_VOID__VOID,
+		  G_TYPE_NONE,
+		  0);
+
   g_object_class_install_property
     (object_class,
      PROP_PROFILE,
@@ -670,6 +698,30 @@
   return g_object_new (TERMINAL_TYPE_SCREEN, NULL);
 }
 
+void
+terminal_screen_beep_cb (TerminalScreen *screen)
+{
+  TerminalScreenPrivate *priv;
+  gboolean should_highlight;
+
+  priv = screen->priv;
+  should_highlight = terminal_profile_get_property_boolean (priv->profile, TERMINAL_PROFILE_HIGHLIGHT_ON_BELL);
+  if (should_highlight)
+    {
+      VteTerminal *terminal = VTE_TERMINAL (screen);
+      if (!GTK_WIDGET_HAS_FOCUS (terminal))
+      g_signal_emit_by_name (screen, "highlight-screen");
+    }
+}
+
+gboolean
+terminal_screen_focus_cb (TerminalScreen *screen)
+{
+  g_signal_emit_by_name (screen, "unhighlight-screen");
+
+  return FALSE;
+}
+
 const char*
 terminal_screen_get_raw_title (TerminalScreen *screen)
 {
Index: src/profile-preferences.glade
===================================================================
--- src/profile-preferences.glade	(revision 3202)
+++ src/profile-preferences.glade	(working copy)
@@ -291,6 +291,25 @@
 	      </child>
 
 	      <child>
+		<widget class="GtkCheckButton" id="highlightonbell-checkbutton">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">_Highlight background tab on bell</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
 		<widget class="GtkHBox" id="hbox140">
 		  <property name="visible">True</property>
 		  <property name="homogeneous">False</property>
Index: src/terminal-screen.h
===================================================================
--- src/terminal-screen.h	(revision 3202)
+++ src/terminal-screen.h	(working copy)
@@ -70,6 +70,9 @@
                                int flavour,
                                guint state);
   void (* close_screen)       (TerminalScreen *screen);
+
+  void (* highlight_screen)   (TerminalScreen *screen);
+  void (* unhighlight_screen) (TerminalScreen *screen);
 };
 
 GType terminal_screen_get_type (void) G_GNUC_CONST;
Index: src/terminal-profile.c
===================================================================
--- src/terminal-profile.c	(revision 3202)
+++ src/terminal-profile.c	(working copy)
@@ -86,6 +86,7 @@
   PROP_USE_THEME_COLORS,
   PROP_VISIBLE_NAME,
   PROP_WORD_CHARS,
+  PROP_HIGHLIGHT_ON_BELL,
   LAST_PROP
 };
 
@@ -103,6 +104,7 @@
 #define KEY_EXIT_ACTION "exit_action"
 #define KEY_FONT "font"
 #define KEY_FOREGROUND_COLOR "foreground_color"
+#define KEY_HIGHLIGHT_ON_BELL "highlight_on_bell"
 #define KEY_LOGIN_SHELL "login_shell"
 #define KEY_NO_AA_WITHOUT_RENDER "no_aa_without_render" 
 #define KEY_PALETTE "palette"
@@ -138,6 +140,7 @@
 #define DEFAULT_EXIT_ACTION           (TERMINAL_EXIT_CLOSE)
 #define DEFAULT_FONT                  ("Monospace 12")
 #define DEFAULT_FOREGROUND_COLOR      ("#000000")
+#define DEFAULT_HIGHLIGHT_ON_BELL     (FALSE)
 #define DEFAULT_LOGIN_SHELL           (FALSE)
 #define DEFAULT_NAME                  (NULL)
 #define DEFAULT_NO_AA_WITHOUT_RENDER  (TRUE)
@@ -1262,6 +1265,7 @@
 
   TERMINAL_PROFILE_PROPERTY_BOOLEAN (ALLOW_BOLD, DEFAULT_ALLOW_BOLD, KEY_ALLOW_BOLD);
   TERMINAL_PROFILE_PROPERTY_BOOLEAN (DEFAULT_SHOW_MENUBAR, DEFAULT_DEFAULT_SHOW_MENUBAR, KEY_DEFAULT_SHOW_MENUBAR);
+  TERMINAL_PROFILE_PROPERTY_BOOLEAN (HIGHLIGHT_ON_BELL, DEFAULT_HIGHLIGHT_ON_BELL, KEY_HIGHLIGHT_ON_BELL);
   TERMINAL_PROFILE_PROPERTY_BOOLEAN (LOGIN_SHELL, DEFAULT_LOGIN_SHELL, KEY_LOGIN_SHELL);
   TERMINAL_PROFILE_PROPERTY_BOOLEAN (NO_AA_WITHOUT_RENDER, DEFAULT_NO_AA_WITHOUT_RENDER, KEY_NO_AA_WITHOUT_RENDER);
   TERMINAL_PROFILE_PROPERTY_BOOLEAN (SCROLL_BACKGROUND, DEFAULT_SCROLL_BACKGROUND, KEY_SCROLL_BACKGROUND);
Index: src/terminal-profile.h
===================================================================
--- src/terminal-profile.h	(revision 3202)
+++ src/terminal-profile.h	(working copy)
@@ -80,6 +80,7 @@
 #define TERMINAL_PROFILE_EXIT_ACTION            "exit-action"
 #define TERMINAL_PROFILE_FONT                   "font"
 #define TERMINAL_PROFILE_FOREGROUND_COLOR       "foreground-color"
+#define TERMINAL_PROFILE_HIGHLIGHT_ON_BELL      "highlight-on-bell"
 #define TERMINAL_PROFILE_LOGIN_SHELL            "login-shell"
 #define TERMINAL_PROFILE_NAME                   "name"
 #define TERMINAL_PROFILE_NO_AA_WITHOUT_RENDER   "no-aa-without-render"
Index: src/terminal-window.c
===================================================================
--- src/terminal-window.c	(revision 3202)
+++ src/terminal-window.c	(working copy)
@@ -2028,6 +2028,46 @@
   gtk_widget_set_size_request (button, w + 2, h + 2);
 }
 
+static void
+highlight_screen_cb (TerminalScreen *screen, GtkLabel *label)
+{
+  GtkWidget *toplevel;
+  gboolean has_toplevel_focus;
+  PangoAttrList *attrs;
+  PangoAttribute *weight;
+ 
+  toplevel = gtk_widget_get_toplevel (GTK_WIDGET (screen));
+  g_object_get (toplevel, "has-toplevel-focus", &has_toplevel_focus, NULL);
+  if (!has_toplevel_focus)
+    gtk_window_set_urgency_hint (GTK_WINDOW (toplevel), TRUE);
+
+  attrs = gtk_label_get_attributes (label);
+  if (!attrs)
+    attrs = pango_attr_list_new ();
+  weight = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
+  pango_attr_list_change (attrs, weight);
+  gtk_label_set_attributes (label, attrs);
+}
+
+static void
+unhighlight_screen_cb (TerminalScreen *screen, GtkLabel *label)
+{
+  GtkWidget *toplevel;
+  PangoAttrList *attrs;
+  PangoAttribute *weight;
+
+  /* Focusing any tab clears the urgency hint on the whole window */
+  toplevel = gtk_widget_get_toplevel (GTK_WIDGET (screen));
+  gtk_window_set_urgency_hint (GTK_WINDOW (toplevel), FALSE);
+
+  attrs = gtk_label_get_attributes (label);
+  if (!attrs)
+    attrs = pango_attr_list_new ();
+  weight = pango_attr_weight_new (PANGO_WEIGHT_NORMAL);
+  pango_attr_list_change (attrs, weight);
+  gtk_label_set_attributes (label, attrs);
+}
+
 static GtkWidget *
 construct_tab_label (TerminalScreen *screen, GtkWidget *screen_container)
 {
@@ -2064,6 +2104,12 @@
   g_signal_connect (hbox, "style-set",
                     G_CALLBACK (tab_label_style_set_cb), close_button);
 
+  g_signal_connect (screen, "highlight-screen",
+                    G_CALLBACK (highlight_screen_cb), label);
+
+  g_signal_connect (screen, "unhighlight-screen",
+                    G_CALLBACK (unhighlight_screen_cb), label);
+
   gtk_widget_show_all (hbox);
 
   return hbox;
Index: src/gnome-terminal.schemas.in
===================================================================
--- src/gnome-terminal.schemas.in	(revision 3202)
+++ src/gnome-terminal.schemas.in	(working copy)
@@ -247,6 +247,20 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/gnome-terminal/profiles/Default/highlight_on_bell</key>
+      <applyto>/apps/gnome-terminal/profiles/Default/highlight_on_bell</applyto>
+      <owner>gnome-terminal</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+         <short>Whether to highlight an unfocused tab/window when the terminal emits a bell</short>
+         <long>
+          If true, highlight the tab/window.
+         </long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/gnome-terminal/profiles/Default/word_chars</key>
       <applyto>/apps/gnome-terminal/profiles/Default/word_chars</applyto>
       <owner>gnome-terminal</owner>
Index: src/profile-editor.c
===================================================================
--- src/profile-editor.c	(revision 3202)
+++ src/profile-editor.c	(working copy)
@@ -217,6 +217,10 @@
     SET_SENSITIVE ("bell-checkbutton",
                    !terminal_profile_property_locked (profile, TERMINAL_PROFILE_SILENT_BELL));
 
+  if (!prop_name || prop_name == I_(TERMINAL_PROFILE_HIGHLIGHT_ON_BELL))
+    SET_SENSITIVE ("highlightonbell-checkbutton",
+                   !terminal_profile_property_locked (profile, TERMINAL_PROFILE_HIGHLIGHT_ON_BELL));
+
   if (!prop_name || prop_name == I_(TERMINAL_PROFILE_WORD_CHARS))
     SET_SENSITIVE ("word-chars-entry",
                    !terminal_profile_property_locked (profile, TERMINAL_PROFILE_WORD_CHARS));
@@ -824,6 +828,7 @@
   CONNECT ("use-theme-colors-checkbutton", TERMINAL_PROFILE_USE_THEME_COLORS);
   CONNECT ("word-chars-entry", TERMINAL_PROFILE_WORD_CHARS);
   CONNECT_WITH_FLAGS ("bell-checkbutton", TERMINAL_PROFILE_SILENT_BELL, FLAG_INVERT_BOOL);
+  CONNECT ("highlightonbell-checkbutton", TERMINAL_PROFILE_HIGHLIGHT_ON_BELL);
   CONNECT_WITH_FLAGS ("scrollback-lines-spinbutton", TERMINAL_PROFILE_SCROLLBACK_LINES, 0);
 
 #undef CONNECT
Index: help/C/gnome-terminal.xml
===================================================================
--- help/C/gnome-terminal.xml	(revision 3195)
+++ help/C/gnome-terminal.xml	(working copy)
@@ -840,6 +840,15 @@
           </varlistentry> 
           <varlistentry> 
              <term> 
+                <guilabel>Highlight on bell</guilabel> </term> 
+             <listitem> 
+                <para>
+                  Select this option to bold the tab title/flash the window list entry if the terminal emits a bell and the tab/window is not focused.
+                </para>
+             </listitem> 
+          </varlistentry> 
+          <varlistentry> 
+             <term> 
                 <guilabel>Select-by-word characters</guilabel> </term> 
              <listitem> 
                 <para>
