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

qa: Add uiProgressBar tests and fix darwin. #239

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

szanni
Copy link
Contributor

@szanni szanni commented Oct 28, 2023

Two visual tests for uiProgressBar.

The second one fails on my system: macOS 11.7 (Big Sur) . Setting -1 after previously having set some other value will not return to the expected moving bar animation as before but flash the last value in a weird way.

The third patch in this series fixes this by calling [p->pi displayIfNeeded]; .
Another thing that seems to work is calling [p->pi setUsesThreadedAnimation:NO]; and [p->pi setUsesThreadedAnimation:YES]; but I found this to be cleaner.

Another possible issue that qa > uiProgressBar > 2. highlights is the delay when setting a value on darwin whilst the progress bar is animating.
I was able to get an instant set by encapsulating the setIndeterminate call. Happy to include that in this patch set.

Edit: I included the patch to stop the animation instantly (by killing the thread) and set the new value without the (~1 second) delay I was experiencing on my system.
I also added an early return when setting -1 when we are already animating to match unix and windows. Good old defensive programming.

Verify that the indeterminate progress bar animation is properly
started/stopped depending on the value set.
uiProgressBarSetValue(-1) will not display a correct indeterminate
progress bar animation if a value other than -1 has previously
been set.

Fixes:
qa > uiProgressBar > Progress Bar Indeterminate Start/Stop Animation
Kill the progress bar animation thread to visually display the
value change when setting a value [0, 100] when the progress bar
is in an indeterminate state.
This removes the ~1 second delay that it would otherwise take on
macOS 11.7 and possibly other versions.
@matyalatte
Copy link
Contributor

matyalatte commented Feb 4, 2024

I can't confirm the issue on my mac.
But confirmed that the qa test works as the description says on Windows10, Ubuntu 20.04, and macOS 10.15.

Here are the results.

1. Progress Bar Values
qa-progressbar-win.mp4
qa-progressbar-linux.mp4
qa-progressbar-mac.mp4
2. Progress Bar Indeterminate Start/Stop Animation
qa-progressbar-win-2.mp4
qa-progressbar-linux-2.mp4
qa-progressbar-mac-2.mp4

@matyalatte
Copy link
Contributor

matyalatte commented Feb 4, 2024

This is a nit but I noticed test/qa/progressbar.c has two blank lines at EOF.
It should have only one blank line.

$ git -c 'core.whitespace=trailing-space,space-before-tab,indent-with-non-tab,tabwidth=2' --no-pager diff --check origin/master
test/qa/entry.c:156: new blank line at EOF.
test/qa/progressbar.c:91: new blank line at EOF.

two_blank_lines

And the message for test/qa/entry.c is from #233. (cody fixed it already at 2746470.)
I recommend that you run the git command with your other PRs.

@matyalatte
Copy link
Contributor

I also noticed the moving progressbar stops its animation when resizing the parent window on Ubuntu 20.04.
Is it a new issue?

qa-progressbar-linux-resize.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants