diff options
Diffstat (limited to 'source/dialogs')
-rw-r--r-- | source/dialogs/dmenu.c | 6 | ||||
-rw-r--r-- | source/dialogs/window.c | 13 |
2 files changed, 12 insertions, 7 deletions
diff --git a/source/dialogs/dmenu.c b/source/dialogs/dmenu.c index 02594572..2ca1540e 100644 --- a/source/dialogs/dmenu.c +++ b/source/dialogs/dmenu.c @@ -92,10 +92,8 @@ static char **get_dmenu ( DmenuModePrivateData *pd, FILE *fd, unsigned int *leng data[l - 1] = '\0'; l--; } - if ( !g_utf8_validate ( data, l, NULL ) ) { - fprintf ( stderr, "String: '%s' is not valid utf-8\n", data ); - continue; - } + data = rofi_force_utf8 ( data ); + printf ( "data: %s\n", data ); retv[( *length )] = data; data = NULL; diff --git a/source/dialogs/window.c b/source/dialogs/window.c index 5c2bdc11..57684151 100644 --- a/source/dialogs/window.c +++ b/source/dialogs/window.c @@ -53,8 +53,6 @@ #define WINLIST 32 -#define CLIENTTITLE 100 -#define CLIENTCLASS 50 #define CLIENTSTATE 10 #define CLIENTWINDOWTYPE 10 #define CLIENTROLE 50 @@ -285,7 +283,8 @@ static client* window_client ( xcb_window_t win ) cky = xcb_icccm_get_wm_class ( xcb->connection, c->window ); xcb_icccm_get_wm_class_reply_t wcr; if ( xcb_icccm_get_wm_class_reply ( xcb->connection, cky, &wcr, NULL ) ) { - c->class = g_strdup ( wcr.class_name ); + c->class = rofi_latin_to_utf8_strdup ( wcr.class_name, -1 ); + c->name = rofi_latin_to_utf8_strdup ( wcr.instance_name, -1 ); xcb_icccm_get_wm_class_reply_wipe ( &wcr ); } @@ -295,6 +294,14 @@ static client* window_client ( xcb_window_t win ) c->hint_flags = r.flags; } + /** Do UTF-8 Check, should not be needed, does not hurt here to be paranoid. */ + { + c->title = rofi_force_utf8 ( c->title ); + c->class = rofi_force_utf8 ( c->class ); + c->name = rofi_force_utf8 ( c->name ); + c->role = rofi_force_utf8 ( c->role ); + } + winlist_append ( cache_client, c->window, c ); g_free ( attr ); return c; |