diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-03-01 09:37:20 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-03-01 09:37:20 +0100 |
commit | 8bd7db31d286faf7ce7e7ac40777aa9e5716d4fc (patch) | |
tree | c8752df1b31ba7eeea270248ba4252110b367052 /source/dialogs/dmenu.c | |
parent | 9ee61a64472da87f89dc88f0cfb14049f79bd77d (diff) |
Add message box to view structure. Always add it, disable it when not showing anything
Diffstat (limited to 'source/dialogs/dmenu.c')
-rw-r--r-- | source/dialogs/dmenu.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/dialogs/dmenu.c b/source/dialogs/dmenu.c index 5a264fdd..725b6a2e 100644 --- a/source/dialogs/dmenu.c +++ b/source/dialogs/dmenu.c @@ -110,12 +110,17 @@ static void async_close_callback ( GObject *source_object, GAsyncResult *res, G_ static void read_add ( DmenuModePrivateData * pd, char *data, gsize len ) { + if ( pd->cmd_list_real_length > 0 ){ + if ( find_arg ( "-replace" ) >= 0 ){ + g_free(pd->cmd_list[pd->cmd_list_length]); + pd->cmd_list_length--; + } + } if ( ( pd->cmd_list_length + 2 ) > pd->cmd_list_real_length ) { pd->cmd_list_real_length = MAX ( pd->cmd_list_real_length * 2, 512 ); pd->cmd_list = g_realloc ( pd->cmd_list, ( pd->cmd_list_real_length ) * sizeof ( char* ) ); } char *utfstr = rofi_force_utf8 ( data, len ); - pd->cmd_list[pd->cmd_list_length] = utfstr; pd->cmd_list[pd->cmd_list_length + 1] = NULL; |