bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multicolumn characters and Panels


From: Thomas Dickey
Subject: Re: Multicolumn characters and Panels
Date: Fri, 11 May 2007 20:54:53 -0400 (EDT)

On Fri, 11 May 2007, Sadrul Habib Chowdhury wrote:

* Thomas Dickey had this to say on [18 Feb 2007, 11:08:40 -0500]:
On Sat, Feb 17, 2007 at 05:24:21AM -0500, Sadrul H Chowdhury wrote:
Hi. I came across this bug when using gaim-text. It's kind of difficult to
explain. So I have included a sample test-program:

good...


Hi. To work around this problem, I am using this function just before
I do update_panels: http://pidgin.im/~sadrul/pp/widechar-panel.patch. To
briefly explain, the function goes over all the panels, and if it covers
half of a multi-cell character from a panel below it, this function
replaces the visible half with a blank-space. One problem with this is
that if I move a panel which will expose the whole multi-cell character,
it doesn't always redraw properly.

Can there be a better workaround for this?

I'm not sure - I got sidetracked into other parts of the build, and haven't gotten that deep. Will see what I can do...


Thanks,
Sadrul

I tried to come up with a patch, and I got:
--- ncurses/base/lib_refresh.c
+++ ncurses/base/lib_refresh.c
@@ -150,7 +150,19 @@
           if (last > limit_x)
               last = limit_x;

-           for (j = oline->firstchar, n = j + begx; j <= last; j++, n++) {
+           j = oline->firstchar;
+           n = j + begx;
+           if (j <= last && n && isWidecExt(nline->text[n-1])) {
+               /* It's a multicolumn character. Replace with a space. */
+#if 0
+               NCURSES_CH_T blank = NewChar(BLANK_TEXT);
+               nline->text[n-1] = blank;
+#else
+               nline->text[n-1].chars[0] = ' ';
+#endif
+               CHANGED_CELL(nline, n-1);
+           }
+           for (; j <= last; j++, n++) {
               if (!CharEq(oline->text[j], nline->text[n])) {
                   nline->text[n] = oline->text[j];
                   CHANGED_CELL(nline, n);

It did seem to work (by replacing the wide-character by a space to make sure
it doesn't get displayed at all). However, if I bring up pone again (using
top_panel), the wide-character remains invisible. So I think this probably
is not the best fix. Is there any other fix I should try?

I'm not sure (will try to see).

thanks

--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net




--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]