diff --git a/src/math-window.c b/src/math-window.c
index 42f5df2..3dafa3c 100644
--- a/src/math-window.c
+++ b/src/math-window.c
@@ -399,6 +399,28 @@ create_menu(MathWindow *window)
     add_menu_item(menu, gtk_image_menu_item_new_from_stock(GTK_STOCK_ABOUT, accel_group), G_CALLBACK(about_cb), window);
 }
 
+static void
+focus_out (GtkWidget *widget, GdkEvent *event, gpointer user_data )
+{
+    GtkTextIter start , end ;
+    gtk_text_buffer_get_start_iter(GTK_TEXT_BUFFER (MATH_WINDOW(widget)->priv->equation),&start);
+    gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER (MATH_WINDOW(widget)->priv->equation),&end);
+    gchar* s =   gtk_text_buffer_get_text ( GTK_TEXT_BUFFER (MATH_WINDOW(widget)->priv->equation) , &start, &end , TRUE );
+    int i = strlen(s) ;
+    if (i == 0) {
+    	strcpy ( s, _("Calculator"));
+    } else {
+    	s = g_strdup_printf("%s - %s", s, _("Calculator"));
+    }
+
+    gtk_window_set_title (GTK_WINDOW (widget), s); 
+}
+
+static void
+focus_in (GtkWidget *widget, GdkEvent *event, gpointer user_data )
+{
+    gtk_window_set_title (GTK_WINDOW (widget), _("Calculator")); 
+}
 
 static void
 create_gui(MathWindow *window)
@@ -437,6 +459,8 @@ create_gui(MathWindow *window)
     g_signal_connect(window->priv->buttons, "notify::mode", G_CALLBACK(button_mode_changed_cb), window);
     button_mode_changed_cb(window->priv->buttons, NULL, window);
     gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(window->priv->buttons), TRUE, TRUE, 0);
+    g_signal_connect(GTK_WINDOW(window), "focus-out-event", G_CALLBACK(focus_out), window);
+    g_signal_connect(GTK_WINDOW(window), "focus-in-event", G_CALLBACK(focus_in), window);
     gtk_widget_show(GTK_WIDGET(window->priv->buttons));
 }
 
