This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[sourceware-bugzilla@sources.redhat.com: [Bug cygwin DLL/514] cygwin terminal: wrong color handling in reverse display mode]


Anyone interested in working on cygwin and fixing some
low hanging fruit?

cgf

----- Forwarded message from towo at towo dot net <sourceware-bugzilla> -----

------- Additional Comments From towo at towo dot net  2004-11-11 11:00 -------
The bug is in fhandler_console.cc, function get_win32_attr, where 
foreground and background intensity are explicitly preserved while 
exchanging color values:
      WORD save_fg = win_fg;
      win_fg = (win_bg & BACKGROUND_RED   ? FOREGROUND_RED   : 0) |
               (win_bg & BACKGROUND_GREEN ? FOREGROUND_GREEN : 0) |
               (win_bg & BACKGROUND_BLUE  ? FOREGROUND_BLUE  : 0) |
               (win_fg & FOREGROUND_INTENSITY);
      win_bg = (save_fg & FOREGROUND_RED   ? BACKGROUND_RED   : 0) |
               (save_fg & FOREGROUND_GREEN ? BACKGROUND_GREEN : 0) |
               (save_fg & FOREGROUND_BLUE  ? BACKGROUND_BLUE  : 0) |
               (win_bg & BACKGROUND_INTENSITY);

This approach is wrong (because it's causing unreadable display) 
and should probably be replaced with just:
      WORD save_fg = win_fg;
      win_fg = win_bg;
      win_bg = save_fg;

----- End forwarded message -----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]