Changeset 14c15d9


Ignore:
Timestamp:
Jul 17, 2011, 8:50:27 PM (13 years ago)
Author:
David Benjamin <davidben@mit.edu>
Children:
7e9fa84
Parents:
67e5ba36
git-author:
David Benjamin <davidben@mit.edu> (07/16/11 22:33:34)
git-committer:
David Benjamin <davidben@mit.edu> (07/17/11 20:50:27)
Message:
Use wbkgrndset instead of wbkgdset in _owl_fmtext_wcolor_set

This allows color pairs past 255 in an ext-color-enabled build to work.
In theory anyway. Turns out ncurses is buggy and setcchar doesn't work,
but when the patch is accepted upstream we can update the ncurses in the
locker.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fmtext.c

    r2560529 r14c15d9  
    186186static void _owl_fmtext_wcolor_set(WINDOW *w, short pair)
    187187{
     188  cchar_t background;
     189  wchar_t blank[2];
    188190  if (has_colors()) {
    189       wcolor_set(w,pair,NULL);
    190       wbkgdset(w, COLOR_PAIR(pair));
     191      wcolor_set(w, pair, NULL);
     192      /* Set the background with wbkgrndset so that we can handle color-pairs
     193       * past 256 on ncurses ABI 6 and later. */
     194      blank[0] = ' ';
     195      blank[1] = 0;
     196      setcchar(&background, blank, 0, pair, NULL);
     197      wbkgrndset(w, &background);
    191198  }
    192199}
Note: See TracChangeset for help on using the changeset viewer.