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

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Tue, 23 Apr 2013 22:21:39 +0200

On Tue, Apr 23, 2013 at 03:38:32PM -0400, random832_AT_fastmail.us wrote:
> On Tue, Apr 23, 2013, at 14:34, Roberto E. Vargas Caballero wrote:
> > From: "Roberto E. Vargas Caballero" <k0ga_AT_shike2.com>
> >
> > The commit b78c5085f72 changed the st behaviour enabling BCE capability,
> > that means erase regions using background color. Problem comes when you
> > clear a region with a selection, because in this case the real mode of
> > the
> > Glyph is not the value of term.line[y][x], due in drawregion we had
> > enabled
> > the ATTR_REVERSE bit.
>
> I don't understand the issue. How is this desired behavior? It looks
> like your change makes it toggle the _real_ ATTR_REVERSE bit on the
> selected region, making the selection appear to vanish, and it'll end up
> in the wrong colors once the selection is actually removed.


In drawregion you have:

3172 bool ena_sel = sel.bx != -1;
3173
3174 if(sel.alt ^ IS_SET(MODE_ALTSCREEN))
3175 ena_sel = 0;
...
3190 if(ena_sel && *(new.c) && selected(x, y))
3191 new.mode ^= ATTR_REVERSE;

in selclear:

937 sel.bx = -1;
938 tsetdirt(sel.b.y, sel.e.y);

in bpress:

822 if (sel.snap != 0) {
823 tsetdirt(sel.b.y, sel.e.y);
824 draw();
825 }



It means when you select something you modify the attribute of the selected
region. If you clean the region (or a part) the selection will kept
enabled. You can see the problem in these videos:

  Xterm: http://www.shike2.com/xterm.ogv
  St: http://www.shike2.com/st.ogv


Written this mail I found some problems with the patch I sent, so I am
going to write a second version of it.
Received on Tue Apr 23 2013 - 22:21:39 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 23 2013 - 22:24:05 CEST