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.
This commit is contained in:
outfoxxed 2026-02-08 20:10:11 -08:00
parent 395a1301a8
commit 4429c03837
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E

View file

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