Index: terminal-screen.c
===================================================================
--- terminal-screen.c	(revision 3193)
+++ terminal-screen.c	(working copy)
@@ -173,6 +173,30 @@
 }
 
 static void
+beep_callback (GtkWidget *widget)
+{
+  GtkWidget *gtktoplevel = gtk_widget_get_toplevel (widget);
+  gboolean has_toplevel_focus;
+  g_object_get (gtktoplevel, "has-toplevel-focus", &has_toplevel_focus, NULL);
+  if (!has_toplevel_focus)
+  {
+    GdkWindow *window = gtk_widget_get_parent_window (widget);
+    GdkWindow *toplevel = gdk_window_get_toplevel (window);
+    gdk_window_set_urgency_hint (toplevel, TRUE);
+  }
+}
+
+static gboolean
+focus_in_callback (GtkWidget *widget)
+{
+  GdkWindow *window = gtk_widget_get_parent_window (widget);
+  GdkWindow *toplevel = gdk_window_get_toplevel (window);
+  gdk_window_set_urgency_hint (toplevel, FALSE);
+
+  return FALSE;
+}
+
+static void
 connect_monospace_font_change (TerminalScreen *screen)
 {
   GError *err;
@@ -289,6 +313,7 @@
   TerminalScreen *screen = TERMINAL_SCREEN (widget);
 
   gtk_widget_grab_focus (screen->priv->term);
+
 }
 
 static void
@@ -399,6 +424,15 @@
   g_signal_connect (G_OBJECT (screen), "parent-set",
                     G_CALLBACK (parent_set_callback), 
                     NULL);
+
+  g_signal_connect (G_OBJECT (screen->priv->term), "beep",
+                    G_CALLBACK (beep_callback),
+                    NULL);
+
+  g_signal_connect (G_OBJECT (screen->priv->term), "focus-in-event",
+                    G_CALLBACK (focus_in_callback),
+                    NULL);
+
 }
 
 static void
@@ -2673,3 +2707,4 @@
 
   g_object_unref (G_OBJECT (screen->priv->scrollbar));
 }
+
