From 394be61a656312d3d2562692a5d519f62ef426c9 Mon Sep 17 00:00:00 2001 From: o9000 Date: Tue, 20 Jun 2017 11:38:37 +0200 Subject: [PATCH] Collapse executor if output is empty (fixes issue #648) --- src/execplugin/execplugin.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/execplugin/execplugin.c b/src/execplugin/execplugin.c index 75fc013..ae19473 100644 --- a/src/execplugin/execplugin.c +++ b/src/execplugin/execplugin.c @@ -140,7 +140,7 @@ void init_execp() execp->backend->bg = &g_array_index(backgrounds, Background, 0); execp->backend->buf_capacity = 1024; execp->backend->buf_output = calloc(execp->backend->buf_capacity, 1); - execp->backend->text = strdup(" "); + execp->backend->text = strdup(""); execp->backend->icon_path = NULL; } } @@ -321,6 +321,21 @@ void execp_compute_icon_text_geometry(Execp *execp, *icon_w = *icon_h = 0; } + if ((*icon_h == 0 || *icon_w == 0) && execp->backend->text[0] == 0) { + *new_size = 0; + *txt_height_ink = 0; + *txt_height = 0; + *txt_width = 0; + if (panel_horizontal) { + if (area->width) + *resized = TRUE; + } else { + if (area->height) + *resized = TRUE; + } + return; + } + *text_next_line = !panel_horizontal && *icon_w > area->width / 2; int available_w, available_h;