diff --git a/modules/gui/qt/maininterface/qml/MainInterface.qml b/modules/gui/qt/maininterface/qml/MainInterface.qml index 57897e53e7107815fbab2f94a19b2051f4b4cfa9..400a06542197666733f11cd0a89f317b6755f980 100644 --- a/modules/gui/qt/maininterface/qml/MainInterface.qml +++ b/modules/gui/qt/maininterface/qml/MainInterface.qml @@ -44,6 +44,14 @@ Item { property bool _extendedFrameVisible: MainCtx.windowSuportExtendedFrame && MainCtx.clientSideDecoration && (MainCtx.intfMainWindow.visibility === Window.Windowed) + readonly property bool _csdShadowVisible: _extendedFrameVisible && !MainCtx.platformHandlesShadowsWithCSD() + property Item _csdShadow + + on_CsdShadowVisibleChanged: { + if (root._csdShadowVisible && !root._csdShadow) { + root._csdShadow = shadowEffectComponent.createObject(root) + } + } //when exiting minimal mode, what is the page to restore property bool _minimalRestorePlayer: false @@ -325,39 +333,43 @@ Item { } } - //draw the window drop shadow ourselve when the windowing system doesn't - //provide them but support extended frame - Widgets.RectangularGlow { - id: effect - z: -1 - hollow: Window.window && (Window.window.color.a < 1.0) // the interface may be translucent if the window has backdrop blur - blending: false // stacked below everything, no need for blending even though it is not opaque - visible: _extendedFrameVisible && !MainCtx.platformHandlesShadowsWithCSD() - anchors.fill: g_mainInterface - spread: 0.0 - color: "black" - opacity: 0.5 - cornerRadius: glowRadius - states: [ - State { - when: MainCtx.intfMainWindow.active - PropertyChanges { - target: effect - glowRadius: MainCtx.windowExtendedMargin * 0.7 + Component { + id: shadowEffectComponent + + //draw the window drop shadow ourselve when the windowing system doesn't + //provide them but support extended frame + Widgets.RectangularGlow { + id: effect + z: -1 + hollow: Window.window && (Window.window.color.a < 1.0) // the interface may be translucent if the window has backdrop blur + blending: false // stacked below everything, no need for blending even though it is not opaque + visible: root._csdShadowVisible + anchors.fill: g_mainInterface + spread: 0.0 + color: "black" + opacity: 0.5 + cornerRadius: glowRadius + states: [ + State { + when: MainCtx.intfMainWindow.active + PropertyChanges { + target: effect + glowRadius: MainCtx.windowExtendedMargin * 0.7 + } + }, + State { + when: !MainCtx.intfMainWindow.active + PropertyChanges { + target: effect + glowRadius: MainCtx.windowExtendedMargin * 0.5 + } } - }, - State { - when: !MainCtx.intfMainWindow.active - PropertyChanges { - target: effect - glowRadius: MainCtx.windowExtendedMargin * 0.5 + ] + Behavior on glowRadius { + NumberAnimation { + duration: VLCStyle.duration_veryShort } } - ] - Behavior on glowRadius { - NumberAnimation { - duration: VLCStyle.duration_veryShort - } } } }