-
Notifications
You must be signed in to change notification settings - Fork 722
Fixes #4204. v2win and v2net aren't refreshing the Character Map correctly #4205
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
Fixes #4204. v2win and v2net aren't refreshing the Character Map correctly #4205
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i read this correct you are forcing an explicit redraw on every invoke user does?
This violates v2 design of redraw rate limiting.
There should only ever be 1 layout/redraw per iteration and it should come from the new loop I wrote.
Correct way to handle this would be for whoever wants redrawn to set their NeedsDraw flag instead.
Oh - I see this is actually going to do just the flags because of the override on the method... Still i dont think every invoke should force this flag. If user code invokes it should set its own flag and only if it really does want redrawn |
I think the main problem is the legacy drivers already set the console size in the Init method before call the Begin method and the V2 drivers only do that in the first iteration in the Begin method. |
I fixed this already. Maybe it was just in my active PR. I'll look later. |
Nope. I mis-remembered. This bug still exists in #4126. |
@tznind has right about some bug in the redraw by not clearing correctly draw flags. |
Oops. Was running an older pull on this machine. I did already fix this! This is the fix, in ![]() |
I recommend this (at line 248 of View.cs): // Force a layout each time a View is initialized
// See: https://github.com/gui-cs/Terminal.Gui/issues/3951
// See: https://github.com/gui-cs/Terminal.Gui/issues/4204
Layout (); |
Actually, please add these comments as well: // Force a layout each time a View is initialized
// See: https://github.com/gui-cs/Terminal.Gui/issues/3951
// See: https://github.com/gui-cs/Terminal.Gui/issues/4204
Layout ();
// Complex layout scenarios (e.g. DimAuto and PosAlign) may require multiple layouts to be performed.
// Thus, we call SetNeedsLayout() to ensure that the layout is performed at least once.
SetNeedsLayout (); |
Thanks for your fix. I really didn't saw that before. It really fix the v2 driver refresh but not the constantly redrawing in the legacy drivers as @tznind related. In the v2 drivers this doesn't happens because they only rely on |
Great. But you agree the fix I posted above fixes THIS issue (#4204)? Right? |
Yes, absolutely. |
The CI pass on my laptop using Windows and Linux. So I think this is a race condition. |
Running again the unit tests it really failed. I merged into this the #4209 PR which fix the SyncrhonizationContextTests. |
@BDisp - Integration tests are still failing. |
I run now without errors. I think that is a racing condition where a collection is being modified in the \IntegrationTests\FluentTests\MenuBarv2Tests.cs:line 454 when executing "Application.Top!.Add (menuBar);" which will modify a collection. |
This reverts commit 3aaefd6.
I think FluentTests are running in parallel which is causing different results sometimes. Now passed without any change. So, what I said above has some sense. |
Fixes
Proposed Changes/Todos
Application.LayoutAndDrawImpl (true);
in theMainThreadId
Pull Request checklist:
CTRL-K-D
to automatically reformat your files before committing.dotnet test
before commit///
style comments)