Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#54 wbkgd() only changes attributes of some cells

closed-wont-fix
None
5
2007-05-04
2007-04-23
Davi R. Tavares
No

A window created with subwin/derwin doesn't draw (even calling touchwin before) when calling wrefresh. I don't know if it could be a bug or no, but, on ncurses it worked fine.

Discussion

  • An example of the problem...

     
    Attachments
  • Logged In: YES
    user_id=27933
    Originator: NO

    It does draw -- in the example program, try printing some text to w1 before the refresh. It seems to be wbkgd() that's behaving differently. I'll look into it further.

     
  • Logged In: YES
    user_id=27933
    Originator: NO

    P.S. For now, a "werase(w1)" before the refresh will help.

     
  • Logged In: YES
    user_id=27933
    Originator: NO

    OK, if you move the wbkgd() call for w2 to before the derwin() call, you'll get the effect you want, without having to call werase().

    What's happening here is that wbkgd() only changes the attributes for cells that already have the old background attribute. At the time of the derwin() call in test.c, the background for w2 is still 0; so when wbkgd() is called for w1, it compares against 0, finds that the cells aren't that color, and doesn't recolor them.

    ncurses, on the other hand, recolors all the cells, not just the cells that match the background. According to my reading of the X/Open standard, that's actually the correct behavior. I ran into this shortly after I took over PDCurses, but at that time, I decided _not_ to fix it, because I liked PDCurses' behavior better. It's the only time I've done that, and I may have to revisit that decision.

     
    • assigned_to: nobody --> wmcbrine
    • summary: A window create with subwin doesn't draw --> wbkgd() only changes attributes of some cells
    • status: open --> open-later
     
  • Logged In: YES
    user_id=27933
    Originator: NO

    My reading of the Solaris source code seems to indicate the same behavior, although I can't test it at the moment.

     
    • status: open-later --> pending-wont-fix
     
    • status: pending-wont-fix --> closed-wont-fix