diff options
author | Timo Sirainen <cras@irssi.org> | 2001-03-04 03:35:12 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-03-04 03:35:12 +0000 |
commit | a1842e6baa56e1dda9729458f537236485348388 (patch) | |
tree | bd03db9297e86f306c644c55a450ace0e8d569c8 /src/fe-text | |
parent | cf376ba806431a355c29486f1250953295f880e7 (diff) | |
download | irssi-a1842e6baa56e1dda9729458f537236485348388.zip |
Statusbar could have gotten to endless loop trying to grow size of some
item when there was no space left.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1342 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/statusbar.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/fe-text/statusbar.c b/src/fe-text/statusbar.c index 775bc87a..99c739ea 100644 --- a/src/fe-text/statusbar.c +++ b/src/fe-text/statusbar.c @@ -34,6 +34,7 @@ void statusbar_items_deinit(void); static GSList *statusbars; static int sbar_uppest, sbar_lowest, sbars_up, sbars_down; +static int item_max_size; static void statusbar_item_destroy(SBAR_ITEM_REC *rec) { @@ -66,6 +67,7 @@ static void statusbar_redraw_line(STATUSBAR_REC *bar) if (rec->shrinked) rec->size = COLS-1-xpos; + item_max_size = COLS-1-xpos; func = (STATUSBAR_FUNC) rec->func; func(rec, bar->ypos); @@ -81,6 +83,7 @@ static void statusbar_redraw_line(STATUSBAR_REC *bar) if (rec->right_justify && rxpos-rec->size > xpos) { rec->xpos = rxpos-rec->size; + item_max_size = rxpos-xpos; func = (STATUSBAR_FUNC) rec->func; func(rec, bar->ypos); @@ -232,8 +235,10 @@ void statusbar_item_resize(SBAR_ITEM_REC *item, int size) { g_return_if_fail(item != NULL); - item->size = size; - statusbar_redraw_all(); + if (size <= item_max_size) { + item->size = size; + statusbar_redraw_all(); + } } void statusbar_item_remove(SBAR_ITEM_REC *item) |