From 4429c038377a2c59dfcab6fe2424fb2c3a99d2cd Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 8 Feb 2026 20:10:11 -0800 Subject: [PATCH] widgets/cliprect: fix ShaderEffect warnings on reload layer.effect causes warnings on reload for an unknown reason which seems to be ownership or destruction time related. This commit uses an alternate strategy to create the shader which does not show this warning. --- src/widgets/ClippingRectangle.qml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/widgets/ClippingRectangle.qml b/src/widgets/ClippingRectangle.qml index 3fc64d8..749b331 100644 --- a/src/widgets/ClippingRectangle.qml +++ b/src/widgets/ClippingRectangle.qml @@ -66,20 +66,22 @@ Item { Item { id: contentItemContainer anchors.fill: root + layer.enabled: true + visible: false Item { id: contentItem anchors.fill: parent anchors.margins: root.contentInsideBorder ? root.border.width : 0 } + } - layer.enabled: true - layer.samplerName: "content" - layer.effect: ShaderEffect { - fragmentShader: `qrc:/Quickshell/Widgets/shaders/cliprect${root.contentUnderBorder ? "-ub" : ""}.frag.qsb` - property Rectangle rect: rectangle - property color backgroundColor: root.color - property color borderColor: root.border.color - } + ShaderEffect { + anchors.fill: contentItemContainer + fragmentShader: `qrc:/Quickshell/Widgets/shaders/cliprect${root.contentUnderBorder ? "-ub" : ""}.frag.qsb` + property Item content: contentItemContainer + property Rectangle rect: rectangle + property color backgroundColor: root.color + property color borderColor: root.border.color } }