-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
fix processEvents()
reentrancy bug in progress manager window handling
#3030
Conversation
5f96bb4
to
53b14cf
Compare
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.
Removing processEvents() is probably the best path forward. Thank you for looking into this!
qt/aqt/progress.py
Outdated
if self._shown: | ||
elapsed_time = time.monotonic() - self._shown | ||
if (time_to_wait := 0.5 - elapsed_time) > 0: | ||
self.mw.taskman.run_in_background( |
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.
Using sleep() in a background thread could be done more simply with self.single_shot()
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.
Oh nice that is perfect!
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.
@dae I just looked at this a little more and we can't actually use single_shot
here since it wraps the callback and won't call it until _levels
is 0 which is the whole point of our callback :/ I'll stick to the threadpool for now and add a comment about it.
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.
Sorry to lead you down the wrong path there - I'd forgotten about that check.
53b14cf
to
b529470
Compare
b529470
to
cc180c6
Compare
Thanks for this Kieran! |
My fix in #3029 was not fully correct, this PR should be a corrected version though.
I implemented the third option from the list of ideas as it removed the
processEvents()
call but am more than happy to pivot to something else entirely if you want! Just lmk.I tested this by playing around with the app for a little bit and inserting artificial delays in an addon. The path where the window was never shown and where we need to delay for half a second both seem to be working. No infinite Processing... windows got stuck open.