From 33fe169edc7f3026caac52733065161a2d09d5a8 Mon Sep 17 00:00:00 2001 From: Wilfred Mallawa Date: Fri, 23 Jan 2026 22:40:44 +1100 Subject: [PATCH] fix(osd): defer first show to prevent percentage text overflow On first OSD display, the percentage text would render outside the bounding box because the layout hadn't finished positioning children. Add a small delay 30ms delay before rendering the OSD, which seems to be enough time to allow for things to synchronize. Signed-off-by: Wilfred Mallawa --- Modules/OSD/OSD.qml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Modules/OSD/OSD.qml b/Modules/OSD/OSD.qml index 7eb65454f..bfcdf03a6 100644 --- a/Modules/OSD/OSD.qml +++ b/Modules/OSD/OSD.qml @@ -740,17 +740,24 @@ Variants { } } + // Delay showing the OSD to allow the layout to settle after activation. + // Without this, the percentage text renders outside the box on first + // show. + Timer { + id: showDelayTimer + interval: 30 + onTriggered: { + osdItem.visible = true; + osdItem.opacity = 1; + osdItem.scale = 1.0; + hideTimer.start(); + } + } + function show() { hideTimer.stop(); visibilityTimer.stop(); - osdItem.visible = true; - - Qt.callLater(() => { - osdItem.opacity = 1; - osdItem.scale = 1.0; - }); - - hideTimer.start(); + showDelayTimer.start(); } function hide() {