migueldeicaza / TermKit

Terminal Kit - Console UI toolkit for Swift applications
MIT License
458 stars 17 forks source link

Investigate redraw across TopLevel Boundaries + Redraw currently Redraws it all #30

Closed migueldeicaza closed 3 years ago

migueldeicaza commented 3 years ago

I suspect that the expose system does not cross the Toplevel boundary, to determine affected regions.

So if a top-level damages the contents below it, we do not send the paint request (right now it might be, we might be overdrawing something, or there might have been a hack I added recently). But I suspect that the redraw logic does not cross toplevel boundaries right now.

Other issues include:

We need a proper system to queue "pendingOperations" and not "postProcessEvent", which is currently called on every input key, but also, from the Terminal emulator as a band-aid.

migueldeicaza commented 3 years ago
        // This is a case where we could have use redrawView, but it
        // currently does not take into consideration a global state of
        // affected areas, which we probably should review.
        //
        // At least we should have a refresh version that does not queue
        // a setNeedsDisplay.   Also see postProcessEvent, it worked
        // in the previous era where the Toplevels would consume the whole
        // screen and full obscure the back, but we should cross those
        // boundaries and repaint even those.
migueldeicaza commented 3 years ago

Idea that I have been mulling around:

Implemented: Toplevels would contain the backing store for the drawn operations, and views retain their existing redraw logic. This means that not every view would need a backing store that needs to be composed. Only toplevels get composed.

migueldeicaza commented 3 years ago

Update:

I now have a backingstore branch with the above idea, and it works.

Some issues that still need work and research:

migueldeicaza commented 3 years ago

Fixed