FreeDVReporter: only force column relayout on visibility/highlight changes
setColumnAutosize_() forces a full column relayout (SetWidth() on every column) on macOS, worked around a wxWidgets rendering bug (see https://github.com/wxWidgets/wxWidgets/issues/25972). It was firing whenever any row's data changed at all (isPendingUpdate), not just when a row's visibility or highlight color changed. On a busy reporter network, isPendingUpdate can be true on effectively every 250ms highlight-timer tick, so this was running continuously rather than only when column widths could plausibly need to change -- matching an observed symptom of the Reporter window's headers redrawing themselves very frequently. Plain data refreshes still go through ItemsChanged() so cell content stays live; only the column-width relayout is now skipped for them. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jz1Nz4hmnEzwQ7hjQtCBhkms-rade-v2
parent
76165aad2c
commit
f013450b89
|
|
@ -1281,6 +1281,18 @@ void FreeDVReporterDialog::FreeDVReporterDataModel::updateHighlights()
|
||||||
wxDataViewItemArray itemsAdded;
|
wxDataViewItemArray itemsAdded;
|
||||||
wxDataViewItemArray itemsChanged;
|
wxDataViewItemArray itemsChanged;
|
||||||
wxDataViewItemArray itemsDeleted;
|
wxDataViewItemArray itemsDeleted;
|
||||||
|
|
||||||
|
// setColumnAutosize_() forces a full column relayout (SetWidth() on
|
||||||
|
// every column -- see the macOS branch below), which is only ever
|
||||||
|
// needed when a row's visibility or highlight color actually
|
||||||
|
// changes. A plain data refresh (isPendingUpdate, e.g. an updated
|
||||||
|
// SNR/frequency from a busy reporter network) still needs its cell
|
||||||
|
// repainted via ItemsChanged() below, but doesn't need the column
|
||||||
|
// widths touched. On a busy network isPendingUpdate can be true on
|
||||||
|
// effectively every 250ms tick, so without this the relayout dance
|
||||||
|
// was running continuously instead of only when actually needed.
|
||||||
|
bool needsColumnAutosize = false;
|
||||||
|
|
||||||
for (auto& item : allReporterData_)
|
for (auto& item : allReporterData_)
|
||||||
{
|
{
|
||||||
if (item.second->isPendingDelete)
|
if (item.second->isPendingDelete)
|
||||||
|
|
@ -1391,18 +1403,26 @@ void FreeDVReporterDialog::FreeDVReporterDataModel::updateHighlights()
|
||||||
|
|
||||||
wxDataViewItem dvi(reportData);
|
wxDataViewItem dvi(reportData);
|
||||||
itemsChanged.Add(dvi);
|
itemsChanged.Add(dvi);
|
||||||
|
|
||||||
|
if (isHighlightUpdated)
|
||||||
|
{
|
||||||
|
needsColumnAutosize = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemsChanged.size() > 0)
|
if (itemsChanged.size() > 0)
|
||||||
{
|
{
|
||||||
setColumnAutosize_(false);
|
if (needsColumnAutosize)
|
||||||
|
{
|
||||||
|
setColumnAutosize_(false);
|
||||||
|
}
|
||||||
ItemsChanged(itemsChanged);
|
ItemsChanged(itemsChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemsAdded.size() > 0 || itemsDeleted.size() > 0 || itemsChanged.size() > 0)
|
if (itemsAdded.size() > 0 || itemsDeleted.size() > 0 || needsColumnAutosize)
|
||||||
{
|
{
|
||||||
setColumnAutosize_(true);
|
setColumnAutosize_(true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue