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

Progress bar text on Linux displays previous text #586

Open
Moo-Marc opened this issue Oct 21, 2022 · 2 comments
Open

Progress bar text on Linux displays previous text #586

Moo-Marc opened this issue Oct 21, 2022 · 2 comments
Assignees
Labels

Comments

@Moo-Marc
Copy link
Collaborator

I noticed this a while ago. (Just tried debugging but couldn't find a fix.)

The progress bar doesn't display the correct text inside the window when it appears. It shows the text from the previous time. The correct text appears if we resize the progress bar window. I tried drawnow, printing to the command window (given apparently similar bug in Linux with fix at line 155), setting the text after the window is visible, nothing worked.

Steps to reproduce: Put breakpoint in bst_progress line 223, start a process input files. The progress bar appears, resize it. It should show "reading input files...". Continue execution, the code pauses again at line 223. The progress bar should now show "initialization...", but it's still "reading input files...". Resize the window and the correct text appears again.

This is true on Linux (Ubuntu 18) Matlab 2021b. If you can't reproduce, let me know what else to test; other Matlab versions, other possible fixes...

Cheers,
Marc

@ftadel
Copy link
Member

ftadel commented Oct 25, 2022

Unfortunately I can't reproduce this on my end.
My Ubuntu is running on the Win10/WSL, and this doesn't seem to happen.

Could you try assembling a single .m script that reproduces this problem?

  • A script that requires brainstorm to be running but that does not use bst_process or any file in the database
  • It would only make calls to bst_progress and random things to wait in between (either calls to wait or loops computing random things)
  • This would help for reproducing the issue identically in different contexts, and find some code to force refreshing the label

For forcing to redraw the label, you could try adding Swing method calls on the various Java objects, either the text label or the frame (pBar.jWindow), the panel (pBar.jPanel), or the label (pBar.jLabel), immediately after setting the text (lines 219 and 285).
It could be functions like: invalidate, revalidate, repaint, pack, setSize, setLocation...
With the debugger stopped in the middle of bst_progress, you can see all the Java objects methods with methodsview, or by typing the name of object in the command window followed with a dot "." and pressing TAB to get the possible automatic completion.

You could also try various window managers on your Ubuntu system, as this is changing a lot the way the graphic objects interact and get refreshed.

@rcassani
Copy link
Member

rcassani commented Nov 1, 2022

Same here, I was not able to reproduce it.
Linux (Cinnamon DE) and Matlab 2020b

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

No branches or pull requests

3 participants