Re: [dev] [PATCH] Fix selecting clearing and BCE

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Tue, 23 Apr 2013 23:05:07 +0200

> That's not true. Only the attribute passed to xdraws() is altered - the
> real attribute stored in the character cell is left alone.
>
> Line 3189 new = term.line[y][x]; makes a _copy_ of
> the Glyph structure, and line 3191 only modifies the copy, not the
> original.


You are right. The problem is the change commit b78c5085f72 inserted in
tclearregion:

1426 for(x = x1; x <= x2; x++) {
1427 term.line[y][x] = term.c.attr;
1428 memcpy(term.line[y][x].c, " ", 2);
1429 }

so *(new.c) is always true in drawregion:

3084 if(ena_sel && *(new.c) && selected(x, y))
3085 new.mode ^= ATTR_REVERSE;

because it is ' '. If we put:

3084 if(ena_sel && *new.c != ' ' && selected(x, y))

we will not be able of selecting spaces anymore, so we can forget it. I
tried writing 0, but it causes segfault in other parts (st since that commit
always had at least a character in c, so the new added coded waits
it). Before commit b7e6a5c (Got rid of redundant Glyph state), we had a
field which could indicate us if the Glyph was set or not, but since them we
are using space for it, so we can not fix this problem anymore.

Maybe could be a good idea insert again the state field in Glyph?, or
someone has other idea about how we can fix it?

Best regards.
Received on Tue Apr 23 2013 - 23:05:07 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 23 2013 - 23:12:06 CEST