[vte/vte-next: 35/114] emove sealed window_title from public struct



commit 4e1179fa4814976c4554af500c3b11eb8550776a
Author: Christian Persch <chpe gnome org>
Date:   Mon May 2 22:44:10 2011 +0200

    emove sealed window_title from public struct

 src/vte-private.h |    1 +
 src/vte.c         |   12 ++++++------
 src/vte.h         |    1 -
 src/vteaccess.c   |    9 ++++-----
 src/vteapp.c      |    3 +--
 src/vteseq.c      |    2 +-
 6 files changed, 13 insertions(+), 15 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index cf8be4a..c10701e 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -358,6 +358,7 @@ struct _VteTerminalPrivate {
 	gboolean contents_changed_pending;
 
 	/* window name changes */
+        gchar *window_title;
 	gchar *window_title_changed;
 	gchar *icon_title_changed;
 
diff --git a/src/vte.c b/src/vte.c
index 4b62adb..293e63c 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -8334,11 +8334,11 @@ vte_terminal_finalize(GObject *object)
 	remove_update_timeout (terminal);
 
 	/* discard title updates */
-	g_free(terminal->pvt->window_title_changed);
+        g_free(terminal->pvt->window_title);
+        g_free(terminal->pvt->window_title_changed);
 	g_free(terminal->pvt->icon_title_changed);
 
 	/* Free public-facing data. */
-	g_free(terminal->window_title);
 	g_free(terminal->icon_title);
 	if (terminal->adjustment != NULL) {
 		g_object_unref(terminal->adjustment);
@@ -13326,7 +13326,7 @@ const char *
 vte_terminal_get_window_title(VteTerminal *terminal)
 {
 	g_return_val_if_fail(VTE_IS_TERMINAL(terminal), "");
-	return terminal->window_title;
+	return terminal->pvt->window_title;
 }
 
 /**
@@ -13723,12 +13723,12 @@ vte_terminal_emit_pending_signals(VteTerminal *terminal)
 	}
 
 	if (terminal->pvt->window_title_changed) {
-		g_free (terminal->window_title);
-		terminal->window_title = terminal->pvt->window_title_changed;
+		g_free (terminal->pvt->window_title);
+		terminal->pvt->window_title = terminal->pvt->window_title_changed;
 		terminal->pvt->window_title_changed = NULL;
 
 		if (window)
-			gdk_window_set_title (window, terminal->window_title);
+			gdk_window_set_title (window, terminal->pvt->window_title);
 		vte_terminal_emit_window_title_changed(terminal);
                 g_object_notify(object, "window-title");
 	}
diff --git a/src/vte.h b/src/vte.h
index be4ccac..4d1893d 100644
--- a/src/vte.h
+++ b/src/vte.h
@@ -69,7 +69,6 @@ struct _VteTerminal {
 	GtkAdjustment *_VTE_SEAL(adjustment);	/* Scrolling adjustment. */
 
 	/* Titles. */
-	char *_VTE_SEAL(window_title);
 	char *_VTE_SEAL(icon_title);
 
 	/*< private >*/
diff --git a/src/vteaccess.c b/src/vteaccess.c
index f06d588..fd7f565 100644
--- a/src/vteaccess.c
+++ b/src/vteaccess.c
@@ -695,7 +695,7 @@ vte_terminal_accessible_title_changed(VteTerminal *terminal, gpointer data)
 {
 	g_assert(VTE_IS_TERMINAL_ACCESSIBLE(data));
 	g_assert(VTE_IS_TERMINAL(terminal));
-	atk_object_set_description(ATK_OBJECT(data), terminal->window_title);
+	atk_object_set_description(ATK_OBJECT(data), vte_terminal_get_window_title(terminal));
 }
 
 /* Reflect focus-in events. */
@@ -776,6 +776,7 @@ vte_terminal_initialize (AtkObject *obj, gpointer data)
 {
 	VteTerminal *terminal;
 	AtkObject *parent;
+        const char *window_title;
 
 	ATK_OBJECT_CLASS (vte_terminal_accessible_parent_class)->initialize (obj, data);
 
@@ -826,10 +827,8 @@ vte_terminal_initialize (AtkObject *obj, gpointer data)
 	}
 
 	atk_object_set_name(obj, "Terminal");
-	atk_object_set_description(obj,
-				   terminal->window_title ?
-				   terminal->window_title :
-				   "");
+        window_title = vte_terminal_get_window_title(terminal);
+	atk_object_set_description(obj, window_title ? window_title : "");
 
 	atk_object_notify_state_change(obj,
 				       ATK_STATE_FOCUSABLE, TRUE);
diff --git a/src/vteapp.c b/src/vteapp.c
index cc8c730..e062ffc 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -45,10 +45,9 @@ window_title_changed(GtkWidget *widget, gpointer win)
 
 	g_assert(VTE_TERMINAL(widget));
 	g_assert(GTK_IS_WINDOW(win));
-	g_assert(VTE_TERMINAL(widget)->window_title != NULL);
 	window = GTK_WINDOW(win);
 
-	gtk_window_set_title(window, VTE_TERMINAL(widget)->window_title);
+	gtk_window_set_title(window, vte_terminal_get_window_title(VTE_TERMINAL(widget)));
 }
 
 static void
diff --git a/src/vteseq.c b/src/vteseq.c
index ce39eda..5d69aa6 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -3227,7 +3227,7 @@ vte_sequence_handler_window_manipulation (VteTerminal *terminal, GValueArray *pa
 			   and CVE-2003-0070. */
 			_vte_debug_print(VTE_DEBUG_PARSE,
 					"Reporting fake window title.\n");
-			/* never use terminal->window_title here! */
+			/* never use terminal->pvt->window_title here! */
 			g_snprintf (buf, sizeof (buf),
 				    _VTE_CAP_OSC "lTerminal" _VTE_CAP_ST);
 			vte_terminal_feed_child(terminal, buf, -1);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]