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

Add window refresh lock to block window from updating while handler is running. #2955

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

cvwillegen
Copy link
Contributor

When a handler is running it may add a lot of widgets to a window. The window keeps updating its layout, leading to an O(n^2) in calls to the refresh() function. When the number of widgets added to a window is doubled, run time is quadrupled (etc).

This leads to slow updates when going from view to view.

My solution is to keep a list of 'dirty' children when a window is locked, so that the children will receive a refresh() call when the window is unlocked. Also, a window is automatically locked when a handler is called that has a window in its interface. No interaction from the user or application programmer is needed to use this functionality.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

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.

1 participant