summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-09-10 20:06:01 +0200
committerDave Davenport <qball@gmpclient.org>2017-09-10 20:06:01 +0200
commit56c373bffca332df593b29b39e1473662891901a (patch)
tree3bca75bf764edb94e9be7061f09bda9bb6e90a69
parent79f6cf2038cf01187074edd40e404f8120398523 (diff)
Allow combi modi to use scripts from the modi list.
fixes: #668
-rw-r--r--source/dialogs/combi.c9
-rw-r--r--source/rofi.c2
2 files changed, 10 insertions, 1 deletions
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 )
{
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++;
}