Changeset 9efa5bd for util.c


Ignore:
Timestamp:
May 1, 2011, 5:29:25 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, 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
  • util.c

    re56303f r9efa5bd  
    715715}
    716716
     717int owl_util_get_colorpairs(void) {
     718#ifndef NCURSES_EXT_COLORS
     719  /* Without ext-color support (an ABI change), ncurses only supports 256
     720   * different color pairs. However, it gives us a larger number even if your
     721   * ncurses is compiled without ext-color. */
     722  return MIN(COLOR_PAIRS, 256);
     723#else
     724  return COLOR_PAIRS;
     725#endif
     726}
     727
    717728gulong owl_dirty_window_on_signal(owl_window *w, gpointer sender, const gchar *detailed_signal)
    718729{
Note: See TracChangeset for help on using the changeset viewer.