summaryrefslogtreecommitdiff
path: root/src/list_generic.c
diff options
context:
space:
mode:
authorSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-03-10 00:49:44 -0500
committerSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-03-10 00:57:22 -0500
commitcd874b642ce9f86d63583b6a2d012d5f445895da (patch)
tree8b3a9cf45a99185fb5ee3ab1f39e47aa8ff81878 /src/list_generic.c
parent9d3938870c639fad97ea9b6cbb23b46cb049c801 (diff)
downloadscreen-cd874b642ce9f86d63583b6a2d012d5f445895da.tar.gz
Make layer-resizing a bit more robust and readable
Instead of killing all overlays when resizing, just kill the ones that cannot be resized, and the resized the rest. This fixes a bug where the window-list (or a group-window) is aborted when layer-size changes (because window-size changed, or caption/hardstatus etc. was toggled). This also makes the code robust. So if you are looking at a window/display list, and the window-size is changed, the list won't go away.
Diffstat (limited to 'src/list_generic.c')
-rw-r--r--src/list_generic.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/list_generic.c b/src/list_generic.c
index 2b3be4c..e32acf7 100644
--- a/src/list_generic.c
+++ b/src/list_generic.c
@@ -344,18 +344,33 @@ static void ListFree(void *d)
static void ListRedisplayLine(int y, int xs, int xe, int isblank)
{
+ struct ListData *ldata;
ASSERT(flayer);
+
+ ldata = flayer->l_data;
if (y < 0)
{
- glist_display_all(flayer->l_data);
+ glist_display_all(ldata);
return;
}
- if (y != 0 && y != flayer->l_height - 1)
- return;
- if (isblank)
- return;
- LClearArea(flayer, xs, y, xe, y, 0, 0);
+ if (!isblank)
+ LClearArea(flayer, xs, y, xe, y, 0, 0);
+
+ if (ldata->top && y < ldata->top->y)
+ ldata->list_fn->gl_printheader(ldata);
+ else if (y + 1 == flayer->l_height)
+ ldata->list_fn->gl_printfooter(ldata);
+ else
+ {
+ struct ListRow *row;
+ for (row = ldata->top; row && row->y != -1; row = row->next)
+ if (row->y == y)
+ {
+ ldata->list_fn->gl_printrow(ldata, row);
+ break;
+ }
+ }
}
static void ListClearLine(int y, int xs, int xe, int bce)