From e8a86fb91c5d51d748d2c782ee146b690756f2b7 Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 31 Dec 2006 22:13:31 +0000 Subject: check return code when setting utf8 workspace names --- src/Ewmh.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Ewmh.cc b/src/Ewmh.cc index 9a3665e..3942fb9 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -462,12 +462,15 @@ void Ewmh::updateWorkspaceNames(BScreen &screen) { } #ifdef X_HAVE_UTF8_STRING - Xutf8TextListToTextProperty(FbTk::App::instance()->display(), + int code = Xutf8TextListToTextProperty(FbTk::App::instance()->display(), names, number_of_desks, XUTF8StringStyle, &text); - XSetTextProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), - &text, m_net_desktop_names); + if (code != XNoMemory && code != XLocaleNotSupported) { + XSetTextProperty(FbTk::App::instance()->display(), + screen.rootWindow().window(), + &text, m_net_desktop_names); - XFree(text.value); + XFree(text.value); + } #else if (XStringListToTextProperty(names, number_of_desks, &text)) { -- cgit v0.11.2