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 { Item {
id: contentItemContainer id: contentItemContainer
anchors.fill: root anchors.fill: root
layer.enabled: true
visible: false
Item { Item {
id: contentItem id: contentItem
anchors.fill: parent anchors.fill: parent
anchors.margins: root.contentInsideBorder ? root.border.width : 0 anchors.margins: root.contentInsideBorder ? root.border.width : 0
} }
}
layer.enabled: true ShaderEffect {
layer.samplerName: "content" anchors.fill: contentItemContainer
layer.effect: ShaderEffect {
fragmentShader: `qrc:/Quickshell/Widgets/shaders/cliprect${root.contentUnderBorder ? "-ub" : ""}.frag.qsb` fragmentShader: `qrc:/Quickshell/Widgets/shaders/cliprect${root.contentUnderBorder ? "-ub" : ""}.frag.qsb`
property Item content: contentItemContainer
property Rectangle rect: rectangle property Rectangle rect: rectangle
property color backgroundColor: root.color property color backgroundColor: root.color
property color borderColor: root.border.color property color borderColor: root.border.color
} }
} }
}