1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

osd: optimize surface damage

fixes #994
This commit is contained in:
bbedward
2025-12-12 15:37:39 -05:00
parent d46302588a
commit c595727b94
3 changed files with 31 additions and 11 deletions

View File

@@ -74,6 +74,7 @@ PanelWindow {
readonly property real dpr: CompositorService.getScreenScale(screen)
readonly property real screenWidth: screen.width
readonly property real screenHeight: screen.height
readonly property real shadowBuffer: 5
readonly property real alignedWidth: Theme.px(osdWidth, dpr)
readonly property real alignedHeight: Theme.px(osdHeight, dpr)
@@ -172,10 +173,16 @@ PanelWindow {
anchors {
top: true
left: true
right: true
bottom: true
}
WlrLayershell.margins {
left: Math.max(0, Theme.snap(alignedX - shadowBuffer, dpr))
top: Math.max(0, Theme.snap(alignedY - shadowBuffer, dpr))
}
implicitWidth: alignedWidth + (shadowBuffer * 2)
implicitHeight: alignedHeight + (shadowBuffer * 2)
Timer {
id: hideTimer
@@ -203,8 +210,8 @@ PanelWindow {
Item {
id: osdContainer
x: alignedX
y: alignedY
x: shadowBuffer
y: shadowBuffer
width: alignedWidth
height: alignedHeight
opacity: shouldBeVisible ? 1 : 0