From 06bbdb04b567939e2d9926743d0f24d153c98d2f Mon Sep 17 00:00:00 2001 From: Nathan Date: Sun, 24 May 2026 16:00:53 -0500 Subject: [PATCH] qt/vulkan: drop debug placeholder painting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vulkan's paintEvent used to paint a muted-purple background plus "Vulkan renderer / awaiting first dmabuf frame" text while waiting for the first frame. That was useful during bring-up — it confirmed the widget was on the Vulkan path even before rendering was wired end-to-end — but it now causes a visible debug flash every time a new surface opens (splits, tabs, new windows). Drop the placeholder; let `m_image.isNull()` early-return like the OpenGL path does. With `WA_TranslucentBackground` the area stays see-through until the first frame imports — same brief gap OpenGL has, no longer broken by debug paint. Co-Authored-By: claude-flow --- qt/src/GhosttySurface.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/qt/src/GhosttySurface.cpp b/qt/src/GhosttySurface.cpp index 93b4a0a8a..a12e54151 100644 --- a/qt/src/GhosttySurface.cpp +++ b/qt/src/GhosttySurface.cpp @@ -377,21 +377,13 @@ void GhosttySurface::renderTerminal() { } void GhosttySurface::paintEvent(QPaintEvent *) { - // Even when on the Vulkan path with a frame imported, the - // widget can still hit a `paintEvent` before the dmabuf has - // landed. Show a placeholder until we have one. - if (m_useVulkan && m_image.isNull()) { - QPainter painter(this); - painter.setCompositionMode(QPainter::CompositionMode_Source); - painter.fillRect(rect(), QColor(40, 22, 56)); // muted purple — debug placeholder - painter.setPen(QColor(220, 220, 220)); - painter.drawText(rect(), - Qt::AlignCenter, - QStringLiteral("Vulkan renderer\n(awaiting first dmabuf frame)")); - paintResizeOverlay(painter); - return; - } - + // No frame yet — leave the widget background untouched. With + // `WA_TranslucentBackground` set the area is transparent until + // the first frame imports, matching the OpenGL path. New surfaces + // (splits, tabs) hit paintEvent before libghostty's renderer + // thread has emitted its first frame; the gap is short enough + // that flashing a debug placeholder is more jarring than the + // brief see-through. if (m_image.isNull()) return; QPainter painter(this); // Blit the framebuffer 1:1. m_image carries the device pixel ratio, so