You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macOS: panels go blank on the first query run after loading a multi-statement snippet #2611
On macOS, the first query run after loading a snippet containing multiple
statements leaves parts of the window unpainted: the database tree on the
left, the query helpers panel on the right, and the text in the SQL editor all
go blank. They stay blank until something forces a redraw -- moving the mouse
over a panel brings it back, and so does running the query a second time.
Reproduces on a clean build of the lazarus branch with no local changes.
HeidiSQL version and OS
HeidiSQL 12.21, lazarus branch at commit a834721, built from source.
macOS 26.6.2, Apple silicon (arm64), cocoa widgetset, Lazarus 4.8 / FPC 3.2.4.
Built locally because the published macOS nightly artifact is x86_64 and is a
bare executable, so it cannot be used with the arm64 app bundle.
Reproduction recipe
Save a snippet containing two or more statements, e.g.
SELECT * FROM some_table;
SELECT * FROM other_table;
Load it from the "Load SQL file / snippet" menu
Run it
The left tree, the right helpers panel and the editor text are blank. Hover a
panel and it repaints. Run again and everything is fine.
A single-statement snippet does not seem to trigger it, and typing the same SQL
into a query tab by hand does not either.
What seems to be happening
TMainForm.AfterQueryExecution creates a TResultTab per result set, and each
of those creates a fresh TVirtualStringTree parented into the query tab
sheet. On cocoa every one of those is a new NSView created part way through
the run, and sibling views end up unpainted.
The second run is clean because by then the grids already exist.
Workaround I am using
Forcing a repaint fixes it, but only if it happens after the run finishes.
I tried, in order, and none of these worked:
repainting right after the result grids are built
repainting at the end of FinishedQueryExecution
using Repaint rather than Invalidate so it happens synchronously
All are too early -- whatever blanks the panels happens after the run returns.
Queueing the repaint works:
// end of TMainForm.FinishedQueryExecution
FRepaintPasses := 2;
Application.QueueAsyncCall(RepaintAfterQuery, 0);
procedureTMainForm.RepaintAfterQuery(Data: PtrInt);
begin
RepaintAllChildren(Self); // recursive Repaint over all child controls
Dec(FRepaintPasses);
if FRepaintPasses > 0then
Application.QueueAsyncCall(RepaintAfterQuery, 0);
end;
Two passes are needed: the helpers panel is fixed by the first, the database
tree only by the second, so the tree is evidently blanked later still.
I am offering this as a description of the behaviour rather than as a fix --
it repaints after the fact, so there is a visible flicker, and the real fix is
presumably to stop the views being blanked in the first place. Happy to test
any alternative.
Note
I used Claude (Anthropic's AI assistant) while investigating this. The
reproduction recipe and the observations above are from my own testing on a
clean build; treat the analysis as a starting point rather than a conclusion.
Activity