Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long-standing repaint-flicker issue. #3408

Open
tig opened this issue Apr 15, 2024 · 8 comments
Open

Long-standing repaint-flicker issue. #3408

tig opened this issue Apr 15, 2024 · 8 comments
Labels
Milestone

Comments

@tig
Copy link
Collaborator

tig commented Apr 15, 2024

There have been long-standing repaint-flicker issues in the libarary. At one point I hoped I fixed them all with a fix to how ClearWhenVisibleFalse was in play.

However, I did something in this #3323 that has caused the problem to re-appear. I've spent HOURs trying to track it down unsuccessfully.

FLUaXgV 1

Here I held down Ctrl-G to repro:

e2DfkaP 1

Originally posted by @tig in #3323 (comment)

See the above thread for a bunch of discussion between @BDisp and I on possible causes... None seem to explain it.

@tig tig changed the title There have been long-standing repaint-flicker issues in the libarary. At one point I thought I fixed them all with a fix to how ClearWhenVisibleFalse was in play. Long-standing repaint-flicker issue. Apr 15, 2024
@tig tig added the bug label Apr 15, 2024
@tig
Copy link
Collaborator Author

tig commented Apr 15, 2024

@BDisp if you're going to look into making Clip more sophisticated, I found the PR I thought I lost where I started down that path:

#2606

@BDisp
Copy link
Collaborator

BDisp commented Apr 15, 2024

I'm done trying to debug this flicker thing for now. So frustrating!

That's true, it's really frustrating. I have also analyzed the cause and I am almost certain that it is necessary to limit the drawing of decorations to their thickness. It could also be someone from Label at Border who is cleaning outside of his area.

@tig
Copy link
Collaborator Author

tig commented Apr 15, 2024

@BDisp if you're going to look into making Clip more sophisticated, I found the PR I thought I lost where I started down that path:

#2606

Nevermind. That branch does not have all the really awesome code I wrote in it. I must have never pushed. Long gone. Sad.

@BDisp
Copy link
Collaborator

BDisp commented Apr 15, 2024

@BDisp if you're going to look into making Clip more sophisticated, I found the PR I thought I lost where I started down that path:

#2606

I've seen it, but it has a lot of unrelated changes and I'd rather start from scratch.

@tig
Copy link
Collaborator Author

tig commented Apr 15, 2024

I'm done trying to debug this flicker thing for now. So frustrating!

That's true, it's really frustrating. I have also analyzed the cause and I am almost certain that it is necessary to limit the drawing of decorations to their thickness. It could also be someone from Label at Border who is cleaning outside of his area.

Note that in #3323, someone has to directly set Driver.Clip to cause Driver.AddRune or Driver.FIllRect to do any drawing outside of Viewport.

The only code still in the library (outside of ViewDrawing.cs that still does that is:

image

Based on this, I'm skeptical it has to do with someone clearing outside of their Viewport.

@BDisp
Copy link
Collaborator

BDisp commented Apr 17, 2024

I have already made the changes to use an array of Rectangles and the same problem continues to persist.
Using conhost directly from VS2022 this flickering does not happen, even though we are using True Color. Just using Windows Terminal this flickering continues and I already suspect if it is a problem with it.
Still, do you want me to submit a PR with the changes to Driver.Clip?

@tig
Copy link
Collaborator Author

tig commented Apr 17, 2024

I have already made the changes to use an array of Rectangles and the same problem continues to persist. Using conhost directly from VS2022 this flickering does not happen, even though we are using True Color. Just using Windows Terminal this flickering continues and I already suspect if it is a problem with it. Still, do you want me to submit a PR with the changes to Driver.Clip?

I don't think an array of Rectangles is the right approach. I think we want to build the next-gen clipping support on a Region class that is either directly this:

https://learn.microsoft.com/en-us/dotnet/api/system.drawing.region?view=dotnet-plat-ext-8.0

Or, is a clone of it.

So, unless you built your experiment on Region, no.

@BDisp
Copy link
Collaborator

BDisp commented Apr 17, 2024

I don't think an array of Rectangles is the right approach. I think we want to build the next-gen clipping support on a Region class that is either directly this:

https://learn.microsoft.com/en-us/dotnet/api/system.drawing.region?view=dotnet-plat-ext-8.0

Or, is a clone of it.

So, unless you built your experiment on Region, no.

By chance I noticed the Region class but I didn't use it to avoid having to add another library. I created a RectangleExtensions class to manipulate its Rectangle methods with the array. But since it didn't solve the problem with flickering and I didn't use the Region class, I'm going to give up on continuing with my PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Status: No status
Development

No branches or pull requests

2 participants