diff options
author | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2017-01-03 12:45:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-03 12:45:50 +0100 |
commit | 01163710e71318c6c2fd3f797f6b878f92b7f97b (patch) | |
tree | 6ef51b247d39692a1d06db1f81eee81aca4531e1 /src/fe-text | |
parent | 5787e2b4befb61585fc312843bd7a5efd0101dce (diff) | |
parent | 9151f87145e6c9ea40192e0e7c8266eacaaa335f (diff) | |
download | irssi-01163710e71318c6c2fd3f797f6b878f92b7f97b.zip |
Merge pull request #585 from ailin-nemui/win_seq
g_sequence backing for window list
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/statusbar-items.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/fe-text/statusbar-items.c b/src/fe-text/statusbar-items.c index 0db4f63a..de4499b4 100644 --- a/src/fe-text/statusbar-items.c +++ b/src/fe-text/statusbar-items.c @@ -143,16 +143,34 @@ static char *get_activity_list(MAIN_WINDOW_REC *window, int normal, int hilight) static void item_act(SBAR_ITEM_REC *item, int get_size_only) { char *actlist; + int max_size; + + if (get_size_only) { + if (activity_list == NULL) + item->min_size = item->max_size = 0; + /* Skip activity calculation on regular trigger, only + set dirty */ + return; + } actlist = get_activity_list(item->bar->parent_window, TRUE, TRUE); if (actlist == NULL) { - if (get_size_only) - item->min_size = item->max_size = 0; return; } - statusbar_item_default_handler(item, get_size_only, + max_size = item->max_size; + statusbar_item_default_handler(item, TRUE, NULL, actlist, FALSE); + statusbar_item_default_handler(item, FALSE, + NULL, actlist, FALSE); + if (max_size != item->max_size) { + /* Due to above hack of skipping the calculation, we + need to manually trigger the redraw process now or + we won't see the item */ + item->bar->dirty = item->dirty = TRUE; + statusbar_redraw(item->bar, TRUE); + statusbar_redraw_dirty(); + } g_free_not_null(actlist); } |