Changeset 9efa5bd for global.c


Ignore:
Timestamp:
May 1, 2011, 5:29:25 PM (13 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
7b4f3be
Parents:
4fd211f
git-author:
David Benjamin <davidben@mit.edu> (04/26/11 21:07:08)
git-committer:
David Benjamin <davidben@mit.edu> (05/01/11 17:29:25)
Message:
Clamp the number of color pairs to 256 without ext-color

Debian doesn't build their ncurses with ext-color support, so it only
supports 256 colorpairs. However, ncurses still reports the full 32768
value, and color pairs end up trampling over each other.

When 256 is exceeded, the existing colorpair reset logic will now kick
in and fix things. Reword a comment accordingly.

While I'm here, get rid of the colorpairs member in owl_global. ncurses'
works just fine.

Reported-by: Mats Ahlgren <mats_a@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • global.c

    r47e0a6a r9efa5bd  
    5454    g->hascolors=1;
    5555  }
    56   g->colorpairs=COLOR_PAIRS;
    5756  owl_fmtext_init_colorpair_mgr(&(g->cpmgr));
    5857  g->debug=OWL_DEBUG;
     
    581580  if (g->hascolors) return(1);
    582581  return(0);
    583 }
    584 
    585 /* color pairs */
    586 
    587 int owl_global_get_colorpairs(const owl_global *g) {
    588   return(g->colorpairs);
    589582}
    590583
Note: See TracChangeset for help on using the changeset viewer.