From 749c341a4b7f9723464af2ac5580437e3d939b9c Mon Sep 17 00:00:00 2001 From: skimo Date: Sat, 9 Jun 2001 22:05:47 +0000 Subject: [PATCH] use SCR for focus; should be more robust --- cl/cl.h | 4 ++-- cl/cl_funcs.c | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/cl/cl.h b/cl/cl.h index 2e8dbb81..8b31b637 100644 --- a/cl/cl.h +++ b/cl/cl.h @@ -6,7 +6,7 @@ * * See the LICENSE file for redistribution information. * - * $Id: cl.h,v 10.28 2001/06/09 18:53:58 skimo Exp $ (Berkeley) $Date: 2001/06/09 18:53:58 $ + * $Id: cl.h,v 10.29 2001/06/09 22:05:47 skimo Exp $ (Berkeley) $Date: 2001/06/09 22:05:47 $ */ #ifdef USE_SLANG_CURSES #include @@ -39,7 +39,7 @@ typedef struct _cl_private { char *oname; /* Original screen window name. */ - WINDOW *focus; /* Screen that has the "focus". */ + SCR *focus; /* Screen that has the "focus". */ int killersig; /* Killer signal. */ #define INDX_HUP 0 diff --git a/cl/cl_funcs.c b/cl/cl_funcs.c index 106a83c0..8bbde2af 100644 --- a/cl/cl_funcs.c +++ b/cl/cl_funcs.c @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: cl_funcs.c,v 10.68 2001/06/09 21:34:14 skimo Exp $ (Berkeley) $Date: 2001/06/09 21:34:14 $"; +static const char sccsid[] = "$Id: cl_funcs.c,v 10.69 2001/06/09 22:05:47 skimo Exp $ (Berkeley) $Date: 2001/06/09 22:05:47 $"; #endif /* not lint */ #include @@ -410,7 +410,6 @@ cl_discard(discardp, acquirep) return 0; for (; (tsp = *acquirep) != NULL; ++acquirep) { - WINDOW *win = CLSP(tsp); clp = CLP(tsp); F_SET(clp, CL_LAYOUT); @@ -418,8 +417,6 @@ cl_discard(discardp, acquirep) delwin(CLSP(tsp)); CLSP(tsp) = subwin(stdscr, tsp->rows, tsp->cols, tsp->roff, tsp->coff); - if (win == clp->focus) - clp->focus = CLSP(tsp); } /* discardp is going away, acquirep is taking up its space. */ @@ -637,7 +634,7 @@ cl_refresh(sp, repaint) */ return (wnoutrefresh(stdscr) == ERR || wnoutrefresh(win) == ERR || - (win == clp->focus && doupdate() == ERR)); + (sp == clp->focus && doupdate() == ERR)); } /* @@ -677,7 +674,7 @@ cl_rename(sp, name, on) clp = CLP(sp); if (on) { - clp->focus = CLSP(sp) ? CLSP(sp) : stdscr; + clp->focus = sp; if (!F_ISSET(clp, CL_RENAME_OK)) return (0); -- 2.11.4.GIT