summaryrefslogtreecommitdiff
path: root/src/session.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2001-10-05 02:58:48 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-10-05 02:58:48 +0000
commit350ecb1dcf5654d747da68351b098014cd3da5ab (patch)
treefb6fe1f2d2e8dc0f8a52eaacc962e3b26e34d339 /src/session.c
parent38a878171ae1831b9c12e4fd019b967ac3e4ea67 (diff)
downloadmetacity-350ecb1dcf5654d747da68351b098014cd3da5ab.tar.gz
metacity-350ecb1dcf5654d747da68351b098014cd3da5ab.tar.bz2
add code to grab all modifier combinations, so keybindings work with
2001-10-04 Havoc Pennington <hp@pobox.com> * src/keybindings.c (meta_change_keygrab): add code to grab all modifier combinations, so keybindings work with NumLock etc. * src/menu.c (meta_window_menu_new): remove newlines from menu items 2001-09-27 Havoc Pennington <hp@pobox.com> * src/session.c (save_state): when encoding text for session file, escape XML entities
Diffstat (limited to 'src/session.c')
-rw-r--r--src/session.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/session.c b/src/session.c
index 452a5d0..525b7da 100644
--- a/src/session.c
+++ b/src/session.c
@@ -665,13 +665,14 @@ window_gravity_from_string (const char *str)
}
static char*
-encode_text_as_utf8 (const char *text)
+encode_text_as_utf8_markup (const char *text)
{
/* text can be any encoding, and is nul-terminated.
* we pretend it's Latin-1 and encode as UTF-8
*/
GString *str;
const char *p;
+ char *escaped;
str = g_string_new ("");
@@ -682,13 +683,16 @@ encode_text_as_utf8 (const char *text)
++p;
}
- return g_string_free (str, FALSE);
+ escaped = g_markup_escape_text (str->str, str->len);
+ g_string_free (str, TRUE);
+
+ return escaped;
}
static char*
decode_text_from_utf8 (const char *text)
{
- /* Convert back from the encoded UTF-8 */
+ /* Convert back from the encoded (but not escaped) UTF-8 */
GString *str;
const char *p;
@@ -803,13 +807,13 @@ save_state (void)
* in practice they are always ascii though.)
*/
- sm_client_id = encode_text_as_utf8 (window->sm_client_id);
+ sm_client_id = encode_text_as_utf8_markup (window->sm_client_id);
res_class = window->res_class ?
- encode_text_as_utf8 (window->res_class) : NULL;
+ encode_text_as_utf8_markup (window->res_class) : NULL;
res_name = window->res_name ?
- encode_text_as_utf8 (window->res_name) : NULL;
+ encode_text_as_utf8_markup (window->res_name) : NULL;
role = window->role ?
- encode_text_as_utf8 (window->role) : NULL;
+ encode_text_as_utf8_markup (window->role) : NULL;
meta_verbose ("Saving session managed window %s, client ID '%s'\n",
window->desc, window->sm_client_id);