summaryrefslogtreecommitdiff
path: root/libwnck
diff options
context:
space:
mode:
authorVincent Untz <vuntz@gnome.org>2007-10-15 22:36:21 +0000
committerVincent Untz <vuntz@src.gnome.org>2007-10-15 22:36:21 +0000
commit59dd22e6636131eb9c8316945efc04866fa490b3 (patch)
treea0ed2e844f2a0a1a465795d14051bf67b1ba7d8f /libwnck
parent741a0ccbc770d46f9f652f950eed28f6a0efa259 (diff)
downloadlibwnck-59dd22e6636131eb9c8316945efc04866fa490b3.tar.gz
Better fix for bug #476299.
2007-10-16 Vincent Untz <vuntz@gnome.org> Better fix for bug #476299. * libwnck/tasklist.c: (wnck_task_get_text): revert the change here * libwnck/util.c: (_wnck_util_sn_utf8_validator): new (_wnck_init): tell libsn to use the glib utf-8 validator svn path=/trunk/; revision=1485
Diffstat (limited to 'libwnck')
-rw-r--r--libwnck/tasklist.c11
-rw-r--r--libwnck/util.c14
2 files changed, 15 insertions, 10 deletions
diff --git a/libwnck/tasklist.c b/libwnck/tasklist.c
index 3e69139..509065a 100644
--- a/libwnck/tasklist.c
+++ b/libwnck/tasklist.c
@@ -3126,21 +3126,12 @@ wnck_task_get_text (WnckTask *task,
case WNCK_TASK_STARTUP_SEQUENCE:
#ifdef HAVE_STARTUP_NOTIFICATION
name = sn_startup_sequence_get_description (task->startup_sequence);
- if (name && !g_utf8_validate (name, -1, NULL))
- name = NULL;
-
if (name == NULL)
name = sn_startup_sequence_get_name (task->startup_sequence);
- if (name && !g_utf8_validate (name, -1, NULL))
- name = NULL;
-
if (name == NULL)
name = sn_startup_sequence_get_binary_name (task->startup_sequence);
- if (name && !g_utf8_validate (name, -1, NULL))
- name = NULL;
- if (name != NULL)
- return g_strdup (name);
+ return g_strdup (name);
#else
return NULL;
#endif
diff --git a/libwnck/util.c b/libwnck/util.c
index d1464f3..a5977b2 100644
--- a/libwnck/util.c
+++ b/libwnck/util.c
@@ -706,6 +706,15 @@ _make_gtk_label_normal (GtkLabel *label)
pango_font_description_free (font_desc);
}
+#ifdef HAVE_STARTUP_NOTIFICATION
+static gboolean
+_wnck_util_sn_utf8_validator (const char *str,
+ int max_len)
+{
+ return g_utf8_validate (str, max_len, NULL);
+}
+#endif /* HAVE_STARTUP_NOTIFICATION */
+
void
_wnck_init (void)
{
@@ -715,6 +724,11 @@ _wnck_init (void)
{
bindtextdomain (GETTEXT_PACKAGE, WNCK_LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+
+#ifdef HAVE_STARTUP_NOTIFICATION
+ sn_set_utf8_validator (_wnck_util_sn_utf8_validator);
+#endif /* HAVE_STARTUP_NOTIFICATION */
+
done = TRUE;
}
}