From 9d7344c8dbcf549d9dd4ce4d3ba0e1fb27468a7c Mon Sep 17 00:00:00 2001 From: deuce <> Date: Sun, 27 Nov 2005 23:31:20 +0000 Subject: [PATCH] Only use cur and bar for new window detection... also, don't allow reset_dynamic() to effect same list detection. --- src/uifc/uifc32.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c index e83551e827..3b90306f84 100644 --- a/src/uifc/uifc32.c +++ b/src/uifc/uifc32.c @@ -511,6 +511,8 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar int a,b,c,longopt; int optheight=0; uchar hclr,lclr,bclr,cclr,lbclr; + static int *oldcur=NULL; + static int *oldbar=NULL; hclr=api->hclr; lclr=api->lclr; @@ -611,7 +613,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar top=0; /* Dynamic Menus */ - if((mode&WIN_DYN || mode&WIN_SAV) + if(mode&WIN_DYN && cur != NULL && bar != NULL && last_menu_cur==cur @@ -621,9 +623,14 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar && save_menu_opts==opts) { if(mode&WIN_DYN) is_redraw=1; - if(mode&WIN_SAV) + } + if(mode&WIN_SAV) { + if(cur==oldcur && bar==oldbar) is_lastwin=1; + oldcur=cur; + oldbar=bar; } + if(mode&WIN_DYN && mode&WIN_REDRAW) is_redraw=1; if(mode&WIN_DYN && mode&WIN_NODRAW) -- GitLab