diff --git a/Modules/OSD/OSD.qml b/Modules/OSD/OSD.qml index 7eb65454f..f43e6a18d 100644 --- a/Modules/OSD/OSD.qml +++ b/Modules/OSD/OSD.qml @@ -456,6 +456,7 @@ Variants { visible: false opacity: 0 scale: 0.85 + property bool pendingShow: false Behavior on opacity { NumberAnimation { @@ -511,9 +512,15 @@ Variants { id: contentLoader anchors.fill: background anchors.margins: Style.marginM - // Delay activation until background has valid dimensions to avoid negative layout sizes - active: background.width > 0 && background.height > 0 + active: true sourceComponent: panel.verticalMode ? verticalContent : horizontalContent + + onWidthChanged: { + if (width > 0 && height > 0 && osdItem.pendingShow) { + osdItem.pendingShow = false; + osdItem.show(); + } + } } Component { @@ -743,6 +750,14 @@ Variants { function show() { hideTimer.stop(); visibilityTimer.stop(); + + // Defer show until content layout has valid geometry + if (contentLoader.width <= 0 || contentLoader.height <= 0) { + pendingShow = true; + return; + } + + pendingShow = false; osdItem.visible = true; Qt.callLater(() => { @@ -764,6 +779,7 @@ Variants { function hideImmediately() { hideTimer.stop(); visibilityTimer.stop(); + pendingShow = false; osdItem.opacity = 0; osdItem.scale = 0.85; osdItem.visible = false;