To answer my own question, I seem to have found the issue:
Basically the tclearregion in resize uses whatever is left in
term.c.attr.bg to paint the background. I bet sometimes there are left
over values ( in this case the cursor background is purple/yellow) and
it got painted all over the newly created region. I added the fix
below to clear the bg to default in tresize before the tclearregion()

 /* Clearing both screens (it makes dirty all lines) */
 term.c.attr.bg = defaultbg;
 c = term.c;
 for (i = 0; i < 2; i++) {
   if (mincol < col && 0 < minrow) {
   tclearregion(mincol, 0, col - 1, minrow - 1);

I guess most people don't really care or the redraw is usually fast
enough to hide this. In my case I work on very slow virtual machines
where this issue is exacerbated.

Thanks,
Kai

On Wed, Jun 24, 2020 at 8:55 AM Kai Ting <kkt...@gmail.com> wrote:
>
> Hi,
> By "default background color" do you mean the default ST color? I tried that 
> already. I tried the default config.def.h colors and also set ST's background 
> to the same color as VIM's background.
>
> Please see attached gifs for a more pronounced example - here vim is busy 
> running and the resize somehow picked up the color of the status bar (purple) 
> in this case. In the xterm version,  you can see the redraw just paints the 
> new space with default black background which is much less jarring. I'm 
> trying to see where in ST's code is picking up this background color that 
> seems to be random part of the original screen. I suspect some clearing 
> /resetting is missing before the redraw.
>
> Thanks,
>
> Kai
>
>
>
> On Wed, Jun 24, 2020 at 2:11 AM Ivan Tham <pickf...@riseup.net> wrote:
>>
>> On Tue, Jun 23, 2020 at 10:34:59PM -0700, Kai Ting wrote:
>> >Hello!
>> >
>> >I have been using st for a while trying to transition fully from xterm.
>> >However one issue I couldn't resolve for the life of me is that under dwm
>> >and st, changing the windows size sometimes results in colored flashes
>> >around the window area before the running application redraws the screen.
>> >Apart from resizing windows, fast scroll back/forward also results in very
>> >bright flashes.  I cannot reproduce the same issue with xterm. Please see
>> >attached gif capturing this issue using vim 8.2, st 0.8.4 and dwm 6.2.
>> >
>> >Any hints/guidance? I looked at the code briefly (xresize() etc) and don't
>> >see anything obvious that can change such behavior.
>>
>> I believe that may be the color you set on vim or the colors set on st.
>> I never experience these behavior using the default color settings.
>>
>> Most likely is because my background color is black, sometimes if the
>> background colors is not the same as the default background color, the
>> default background color will fill up the extra space.
>>
>> Regards,
>> Ivan Tham
>>

Reply via email to