From fa445388e4ae7bf578abc687e09679ee8d1280c6 Mon Sep 17 00:00:00 2001 From: bbedward Date: Tue, 1 Sep 2026 10:50:22 -0400 Subject: [PATCH] island/bar: square blur region corners where goth paths paint square ref #3191 --- quickshell/Modules/DankBar/DankBarBody.qml | 35 ++++++++++++++ .../DankIsland/IslandSatelliteHost.qml | 47 ++++++++++++++++++- 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/quickshell/Modules/DankBar/DankBarBody.qml b/quickshell/Modules/DankBar/DankBarBody.qml index 282ff12a7..d792c2d10 100644 --- a/quickshell/Modules/DankBar/DankBarBody.qml +++ b/quickshell/Modules/DankBar/DankBarBody.qml @@ -265,6 +265,28 @@ Item { } } + Component { + id: blurCornerRegionComp + + // BarCanvas paints square corners at the attached edge and the wing roots (#2975); re-add what the body radius rounds off + Region { + id: cornerRegion + + property bool atRight: false + property bool atBottom: false + + readonly property real r: barBackground.rt + readonly property bool attachedEdgeCorner: (barBackground.isTop && !atBottom) || (barBackground.isBottom && atBottom) || (barBackground.isLeft && !atRight) || (barBackground.isRight && atRight) + readonly property bool wingEdgeCorner: (barBackground.isTop && atBottom) || (barBackground.isBottom && !atBottom) || (barBackground.isLeft && atRight) || (barBackground.isRight && !atRight) + readonly property bool squared: (barBackground.edgeAttached && attachedEdgeCorner) || (barBackground.gothEnabled && wingEdgeCorner) + + x: topBarMouseArea.x + barUnitInset.x + topBarSlide.x + (atRight ? barUnitInset.width - r : 0) + y: topBarMouseArea.y + barUnitInset.y + topBarSlide.y + (atBottom ? barUnitInset.height - r : 0) + width: squared ? r : 0 + height: squared ? r : 0 + } + } + Item { id: barBlur visible: false @@ -319,6 +341,19 @@ Item { } } + if (hasBar) { + for (const atRight of [false, true]) { + for (const atBottom of [false, true]) { + const corner = blurCornerRegionComp.createObject(region, { + atRight: atRight, + atBottom: atBottom + }); + if (corner) + subRegions.push(corner); + } + } + } + region.regions = subRegions; barWindow.blurRegion = region; diff --git a/quickshell/Modules/DankIsland/IslandSatelliteHost.qml b/quickshell/Modules/DankIsland/IslandSatelliteHost.qml index 289aec221..18f73c24f 100644 --- a/quickshell/Modules/DankIsland/IslandSatelliteHost.qml +++ b/quickshell/Modules/DankIsland/IslandSatelliteHost.qml @@ -204,8 +204,8 @@ Item { subRegions.push(islandSub); } for (const chrome of chromes) { - const body = blurItemRegionComp.createObject(region, { - w: chrome + const body = blurChromeRegionComp.createObject(region, { + chrome: chrome }); if (body) subRegions.push(body); @@ -313,6 +313,49 @@ Item { } } + Component { + id: blurChromeRegionComp + + // The chrome paints square corners at the attached edge (and above the sweep in edge mode); square those blur corners too + Region { + id: body + + property Item chrome + + readonly property real cr: body.chrome.cornerR + readonly property real edgeY: body.chrome.bottomEdge ? body.y + body.height - body.cr : body.y + readonly property real sweepY: body.chrome.bottomEdge ? body.y : body.y + body.height - body.cr + readonly property bool sweepSquare: !body.chrome.floating && body.chrome.sweepR > 0 + + x: body.chrome.x + y: body.chrome.y + width: body.chrome.width + height: body.chrome.height + radius: body.cr + + Region { + x: body.x + y: body.edgeY + width: body.cr + height: body.cr + } + + Region { + x: body.x + body.width - body.cr + y: body.edgeY + width: body.cr + height: body.cr + } + + Region { + x: body.chrome.rightSide ? body.x + body.width - body.cr : body.x + y: body.sweepY + width: body.sweepSquare ? body.cr : 0 + height: body.sweepSquare ? body.cr : 0 + } + } + } + Component { id: blurIslandRegionComp