From ec252049243c0b53b583a041ffb1bf006066cce7 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sun, 10 Sep 2017 19:50:26 +0200 Subject: [PATCH 1/3] [RUN] Fix filter duplicates --- source/dialogs/run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dialogs/run.c b/source/dialogs/run.c index 1d482f04..561d02a3 100644 --- a/source/dialogs/run.c +++ b/source/dialogs/run.c @@ -146,7 +146,7 @@ static int sort_func ( const void *a, const void *b, G_GNUC_UNUSED void *data ) else if ( bstr == NULL ) { return -1; } - return g_ascii_strcasecmp ( astr, bstr ); + return g_strcmp0 ( astr, bstr ); } /** From a442dda19ce7fec8763f29e3424b5e32c3d112cc Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sun, 10 Sep 2017 19:55:14 +0200 Subject: [PATCH 2/3] Fix combi modi crashing on dynamic list sizes. --- source/dialogs/combi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/dialogs/combi.c b/source/dialogs/combi.c index 5631c519..a41e54e6 100644 --- a/source/dialogs/combi.c +++ b/source/dialogs/combi.c @@ -125,7 +125,14 @@ static int combi_mode_init ( Mode *sw ) static unsigned int combi_mode_get_num_entries ( const Mode *sw ) { const CombiModePrivateData *pd = (const CombiModePrivateData *) mode_get_private_data ( sw ); - return pd->cmd_list_length; + unsigned int length = 0; + for ( unsigned int i = 0; i < pd->num_switchers; i++ ) { + unsigned int entries = mode_get_num_entries ( pd->switchers[i].mode ); + pd->starts[i] = length; + pd->lengths[i] = entries; + length+=entries; + } + return length; } static void combi_mode_destroy ( Mode *sw ) { From 19cc794018f745be532bd9e98fc2c15b537c9e88 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sun, 10 Sep 2017 20:06:01 +0200 Subject: [PATCH 3/3] Allow combi modi to use scripts from the modi list. fixes: #668 --- source/rofi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/rofi.c b/source/rofi.c index f1a6c600..c13df1fe 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -579,6 +579,8 @@ static int add_mode ( const char * token ) // If not build in, use custom modi. Mode *sw = script_switcher_parse_setup ( token ); if ( sw != NULL ) { + // Add to available list, so combi can find it. + rofi_collect_modi_add(sw); modi[num_modi] = sw; num_modi++; }