Changeset 22662d7 for fmtext.c


Ignore:
Timestamp:
Feb 4, 2011, 5:33:22 PM (13 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
release-1.7
Children:
27705b65
Parents:
b1ed3e2
git-author:
David Benjamin <davidben@mit.edu> (01/25/11 17:27:10)
git-committer:
David Benjamin <davidben@mit.edu> (02/04/11 17:33:22)
Message:
Don't reset colorpairs in the middle of drawing

Resetting colorpairs while drawing the mainwin causes the existing
contents in a popwin to refer to invalid color pairs. We used to draw
the mainwin first and redraw the contents of each window from scratch.
Moving to libpanel in 1.6 changed this, so background colors
occasionally bled into your popwin.

This changes the colorpair logic to only trigger when we need to, and to
forcibly dirty every window if needed. NOTE: if we don't have enough
color-pairs to draw the current screen, this will draw everything twice.
But it will probably almost never happen.

Reported-by: Alex Dehnert <adehnert@mit.edu>
Reviewed-by: Alejandro R. Sedeño <asedeno@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fmtext.c

    rb1ed3e2 r22662d7  
    925925  short i, j;
    926926
     927  cpmgr->overflow = false;
    927928  cpmgr->next = 8;
    928     /* The test is <= because we allocated COLORS+1 entries. */
     929  /* The test is <= because we allocated COLORS+1 entries. */
    929930  for(i = 0; i <= COLORS; i++) {
    930931    for(j = 0; j <= COLORS; j++) {
     
    974975      /* We still don't have a pair, drop the background color. Too bad. */
    975976      owl_function_debugmsg("colorpairs: color shortage - dropping background color.");
     977      cpmgr->overflow = true;
    976978      pair = owl_fmtext_get_colorpair(fg, OWL_COLOR_DEFAULT);
    977979    }
     
    979981      /* We still don't have a pair, defaults all around. */
    980982      owl_function_debugmsg("colorpairs: color shortage - dropping foreground and background color.");
     983      cpmgr->overflow = true;
    981984      pair = 0;
    982985    }
Note: See TracChangeset for help on using the changeset viewer.