From 8232b8ba6d992ad96f5e7fcda662819818c527e4 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sun, 15 Sep 2002 16:39:28 +0000 Subject: [PATCH] escape the window title before saving in the session file, reported by Jos 2002-09-15 Havoc Pennington * src/session.c (save_state): escape the window title before saving in the session file, reported by Jos Vos --- ChangeLog | 5 +++++ src/session.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c37e7ed30..377a33791 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-09-15 Havoc Pennington + + * src/session.c (save_state): escape the window title before + saving in the session file, reported by Jos Vos + 2002-09-12 Havoc Pennington * src/workspace.c (meta_workspace_screen_index) diff --git a/src/session.c b/src/session.c index 0637a9e4c..44f12359d 100644 --- a/src/session.c +++ b/src/session.c @@ -944,6 +944,7 @@ save_state (void) char *res_class; char *res_name; char *role; + char *title; /* client id, class, name, role are not expected to be * in UTF-8 (I think they are in XPCS which is Latin-1? @@ -957,6 +958,10 @@ save_state (void) encode_text_as_utf8_markup (window->res_name) : NULL; role = window->role ? encode_text_as_utf8_markup (window->role) : NULL; + if (window->title) + title = g_markup_escape_text (window->title, -1); + else + title = NULL; meta_topic (META_DEBUG_SM, "Saving session managed window %s, client ID '%s'\n", window->desc, window->sm_client_id); @@ -966,7 +971,7 @@ save_state (void) sm_client_id, res_class ? res_class : "", res_name ? res_name : "", - window->title ? window->title : "", + title ? title : "", role ? role : "", window_type_to_string (window->type), stack_position); @@ -975,6 +980,7 @@ save_state (void) g_free (res_class); g_free (res_name); g_free (role); + g_free (title); /* Sticky */ if (window->on_all_workspaces)