fix: data grid header keeps showing previous table's columns on macOS#2549
Open
twinn1013 wants to merge 1 commit into
Open
fix: data grid header keeps showing previous table's columns on macOS#2549twinn1013 wants to merge 1 commit into
twinn1013 wants to merge 1 commit into
Conversation
Loading the data grid happens inside a paint cycle (OnBeforePaint), and Cocoa discards invalidations issued while a paint cycle is running. The header is painted before OnBeforePaint fires, so after switching tables it kept showing the previous table's columns until some unrelated event repainted the window. Queue an asynchronous repaint which runs right after the current paint cycle, so the new header becomes visible immediately. Darwin-only change.
Collaborator
|
Thanks for your suggested change. I think using |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #2548
On macOS, loading the data grid happens inside a paint cycle (
OnBeforePaint), and Cocoa discards invalidations issued while a paint cycle is running. The header is painted beforeOnBeforePaintfires, so after switching tables it kept showing the previous table's columns until some unrelated event repainted the window (scroll, resize or focus change). Full root cause analysis with lldb backtraces is in the issue.This change queues one asynchronous repaint (
Application.QueueAsyncCall) at the end ofDataGridBeforePaint, which runs right after the current paint cycle finishes, so the new header becomes visible immediately. No query re-execution, and everything is inside{$IFDEF DARWIN}, so Windows and Linux builds are byte-identical.Tested on an M5 Mac: headers now update instantly on every table switch, and sort arrows / column numbering are correct as well.