qt/vulkan: drop debug placeholder painting

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 <ruv@ruv.net>
pull/12846/head
Nathan 2026-05-24 16:00:53 -05:00
parent 0442416ac8
commit 06bbdb04b5
1 changed files with 7 additions and 15 deletions

View File

@ -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