-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX: qt recursive draw #9199
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
Merged
Merged
FIX: qt recursive draw #9199
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- put draw_idle in the base canvas resize event - re-order our resize handling and Qt's resize handling (let Qt go first) - do not call processEvents from inside of the paint event (this maybe the critical fix)
LGTM (and thanks for the patch!), although you may want to check whether this means we should remove a now extraneous draw_idle in other backends? (not that it would really matter as the draw_idles should get compressed into a single one). |
This now fails the Qt5 DPI test... yay! |
The resizeEvent call does put another paint onto the event queue, however it seems that processEvents only processes events on the queue when it is called (not events added while it is processing). This is not clearly documented, but makes sense as this method is for keeping GUIs responsive during otherwise long-running tasks so it should not be able to extend it's run indefinitely by populating the queue. This is required because a previous commit removed the explicit processEvents call in paintEvent as it would occasionally cause recursive painting which may kill Qt.
This prevents flickering during window resize. The issue is that the resize event triggers a paint and we have marked the figure as stale and requiring a re-draw. Sometimes the paint from the resize will process before the single-shot to trigger __draw_idle_agg and there will be a size-mismatch between the QImage and the buffer we are trying to fill it with which results in a visible flicker.
@dopplershift This also fixes the flicker you noticed. |
dopplershift
approved these changes
Sep 25, 2017
thanks |
This was referenced Sep 28, 2017
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Release critical
For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
first)
maybe the critical fix)
closes #9134
PR Summary
PR Checklist