Do not call gtk_window_set_title too often

This commit is contained in:
Yevgen Muntyan 2011-01-14 01:05:08 -08:00
parent dc9d6c19b2
commit 97d2e483d0
3 changed files with 19 additions and 1 deletions

View File

@ -1121,7 +1121,7 @@ update_window_title (MooEditWindow *window)
else
title = parse_title_format (window->priv->title_format_no_doc, NULL);
gtk_window_set_title (GTK_WINDOW (window), title);
moo_window_set_title (MOO_WINDOW (window), title);
g_free (title);
}

View File

@ -979,6 +979,21 @@ moo_window_get_property (GObject *object,
}
void
moo_window_set_title (MooWindow *window,
const char *title)
{
const char *old_title;
moo_return_if_fail (window != NULL);
old_title = gtk_window_get_title (GTK_WINDOW (window));
if (!_moo_str_equal (title, old_title))
gtk_window_set_title (GTK_WINDOW (window), title ? title : "");
}
static void
moo_window_update_toolbar (MooWindow *window)
{

View File

@ -71,6 +71,9 @@ void moo_window_apply_prefs (MooWindow *window);
void moo_window_message (MooWindow *window,
const char *text);
void moo_window_set_title (MooWindow *window,
const char *title);
void moo_window_set_edit_ops_widget (MooWindow *window,
GtkWidget *widget);