qt: temporary stderr diagnostics for the resize-overlay path

Two fprintf calls so we can see what's happening on the user's
machine when they resize:

- showResizeOverlay logs the mode, current grid size, cached last-
  cols/rows, and whether we've registered the first-grid-seen flag.
- paintResizeOverlay logs the cached text, the current and deadline
  timestamps, and the m_owner pointer.

Both write to stderr so they appear when ghastty is launched from a
terminal. The lines are prefixed [ghastty/dbg] for easy grepping;
the diagnostic will be reverted once the rendering path is fixed.

Co-Authored-By: claude-flow <ruv@ruv.net>
pull/12846/head
ntomsic 2026-05-20 17:08:19 -05:00
parent 56918dc3db
commit 7cffdcb0a9
1 changed files with 14 additions and 1 deletions

View File

@ -321,8 +321,16 @@ void GhosttySurface::paintEvent(QPaintEvent *) {
static QString cfgString(ghostty_config_t cfg, const char *key);
void GhosttySurface::paintResizeOverlay(QPainter &painter) {
const qint64 now = QDateTime::currentMSecsSinceEpoch();
std::fprintf(stderr,
"[ghastty/dbg] paintResizeOverlay: text='%s' nowMs=%lld "
"untilMs=%lld owner=%p\n",
m_resizeOverlayText.toUtf8().constData(),
static_cast<long long>(now),
static_cast<long long>(m_resizeOverlayUntilMs),
static_cast<void *>(m_owner));
if (m_resizeOverlayText.isEmpty()) return;
if (QDateTime::currentMSecsSinceEpoch() >= m_resizeOverlayUntilMs) return;
if (now >= m_resizeOverlayUntilMs) return;
if (!m_owner) return;
ghostty_config_t cfg = m_owner->config();
@ -467,6 +475,11 @@ void GhosttySurface::showResizeOverlay() {
const ghostty_surface_size_s sz = ghostty_surface_size(m_surface);
ghostty_config_t cfg = m_owner->config();
const QString mode = cfgString(cfg, "resize-overlay");
std::fprintf(stderr,
"[ghastty/dbg] showResizeOverlay: mode=%s grid=%ux%u "
"lastCols=%d lastRows=%d firstSeen=%d\n",
mode.toUtf8().constData(), sz.columns, sz.rows,
m_lastCols, m_lastRows, m_firstGridSeen ? 1 : 0);
if (mode == QLatin1String("never")) return;
// First-call short-circuit. resizeEvent fires once when the