1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-15 07:35:20 -04:00

refactor(framemode): unify connected surface chrome via SDF pipeline

- Shadow system rewrite with SDF quads
- Replace ConnectedShape/layer FBOs w/frame & chrome SDF shaders
- Improve frame blur performance
- Plugin performance gate
This commit is contained in:
purian23
2026-06-12 11:03:39 -04:00
parent 08fd6e26d8
commit d53809cf2b
52 changed files with 2588 additions and 2804 deletions
+1 -2
View File
@@ -61,7 +61,7 @@ Item {
// M3 elevation shadow — Level 2 baseline (navigation bar), with per-bar override support
readonly property bool hasPerBarOverride: (barConfig?.shadowIntensity ?? 0) > 0
readonly property var elevLevel: Theme.elevationLevel2
readonly property bool shadowEnabled: !BlurService.enabled && ((Theme.elevationEnabled && (typeof SettingsData !== "undefined" ? (SettingsData.barElevationEnabled ?? true) : false)) || hasPerBarOverride)
readonly property bool shadowEnabled: (Theme.elevationEnabled && (typeof SettingsData !== "undefined" ? (SettingsData.barElevationEnabled ?? true) : false)) || hasPerBarOverride
readonly property string autoBarShadowDirection: isTop ? "top" : (isBottom ? "bottom" : (isLeft ? "left" : (isRight ? "right" : "top")))
readonly property string globalShadowDirection: Theme.elevationLightDirection === "autoBar" ? autoBarShadowDirection : Theme.elevationLightDirection
readonly property string perBarShadowDirectionMode: barConfig?.shadowDirectionMode ?? "inherit"
@@ -207,7 +207,6 @@ Item {
shadowOffsetX: root.shadowOffsetX
shadowOffsetY: root.shadowOffsetY
shadowColor: root.shadowColor
blurMax: Theme.elevationBlurMax
}
Loader {
+11 -1
View File
@@ -9,6 +9,8 @@ PanelWindow {
id: barWindow
readonly property var log: Log.scoped("DankBarWindow")
Component.onDestruction: KeyboardFocus.unregisterBarWindow(barWindow)
required property var rootWindow
required property var barConfig
property var modelData: item
@@ -18,6 +20,8 @@ PanelWindow {
property var centerWidgetsModel
property var rightWidgetsModel
readonly property bool barRevealed: inputMask.showing
property var controlCenterButtonRef: null
property var clockButtonRef: null
property var systemUpdateButtonRef: null
@@ -555,6 +559,7 @@ PanelWindow {
color: "transparent"
Component.onCompleted: {
KeyboardFocus.registerBarWindow(barWindow);
updateGpuTempConfig();
_updateBackgroundAlpha();
_updateHasMaximizedToplevel();
@@ -956,8 +961,13 @@ PanelWindow {
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
onClicked: {
const screenName = barWindow.screen?.name;
if (screenName && PopoutManager.currentPopoutsByScreen[screenName])
if (!screenName)
return;
if (PopoutManager.currentPopoutsByScreen[screenName])
PopoutManager.closeAllPopouts();
if (ModalManager.currentModalsByScreen[screenName])
ModalManager.closeAllModalsExcept(null);
TrayMenuManager.closeAllMenus();
}
}
@@ -38,15 +38,7 @@ DankPopout {
backgroundInteractive: !anyModalOpen
customKeyboardFocus: {
if (!shouldBeVisible)
return WlrKeyboardFocus.None;
if (anyModalOpen)
return WlrKeyboardFocus.None;
if (CompositorService.useHyprlandFocusGrab)
return WlrKeyboardFocus.OnDemand;
return WlrKeyboardFocus.Exclusive;
}
customKeyboardFocus: anyModalOpen ? WlrKeyboardFocus.None : null
Connections {
target: SystemUpdateService
@@ -980,21 +980,13 @@ BasePill {
screen: root.parentScreen
WlrLayershell.layer: root.barUsesOverlayLayer ? WlrLayershell.Overlay : WlrLayershell.Top
WlrLayershell.exclusiveZone: -1
WlrLayershell.keyboardFocus: {
if (PopoutManager.screenshotActive)
return WlrKeyboardFocus.None;
if (!root.menuOpen)
return WlrKeyboardFocus.None;
if (CompositorService.useHyprlandFocusGrab)
return WlrKeyboardFocus.OnDemand;
return WlrKeyboardFocus.Exclusive;
}
WlrLayershell.keyboardFocus: KeyboardFocus.keyboardFocus(root.menuOpen, null)
WlrLayershell.namespace: "dms:tray-overflow-menu"
color: "transparent"
HyprlandFocusGrab {
windows: [overflowMenu]
active: CompositorService.useHyprlandFocusGrab && root.useOverflowPopup && root.menuOpen
windows: [overflowMenu].concat(KeyboardFocus.barWindows)
active: root.useOverflowPopup && KeyboardFocus.wantsGrab(root.menuOpen, null)
}
Connections {
@@ -1051,32 +1043,21 @@ BasePill {
"leftBar": 0,
"rightBar": 0
})
readonly property real effectiveBarSize: root.barThickness + root.barSpacing
readonly property real maskX: _overflowDismissZone.x
readonly property real maskY: _overflowDismissZone.y
readonly property real maskWidth: _overflowDismissZone.width
readonly property real maskHeight: _overflowDismissZone.height
readonly property real maskX: {
const triggeringBarX = (barPosition === 2) ? effectiveBarSize : 0;
const adjacentLeftBar = adjacentBarInfo?.leftBar ?? 0;
return Math.max(triggeringBarX, adjacentLeftBar);
}
readonly property real maskY: {
const triggeringBarY = (barPosition === 0) ? effectiveBarSize : 0;
const adjacentTopBar = adjacentBarInfo?.topBar ?? 0;
return Math.max(triggeringBarY, adjacentTopBar);
}
readonly property real maskWidth: {
const triggeringBarRight = (barPosition === 3) ? effectiveBarSize : 0;
const adjacentRightBar = adjacentBarInfo?.rightBar ?? 0;
const rightExclusion = Math.max(triggeringBarRight, adjacentRightBar);
return Math.max(100, width - maskX - rightExclusion);
}
readonly property real maskHeight: {
const triggeringBarBottom = (barPosition === 1) ? effectiveBarSize : 0;
const adjacentBottomBar = adjacentBarInfo?.bottomBar ?? 0;
const bottomExclusion = Math.max(triggeringBarBottom, adjacentBottomBar);
return Math.max(100, height - maskY - bottomExclusion);
DismissZone {
id: _overflowDismissZone
barPosition: overflowMenu.barPosition
barX: overflowMenu.barX
barY: overflowMenu.barY
barWidth: overflowMenu.barWidth
barHeight: overflowMenu.barHeight
screenWidth: overflowMenu.width
screenHeight: overflowMenu.height
adjacentBarInfo: overflowMenu.adjacentBarInfo
}
mask: Region {
@@ -1237,13 +1218,7 @@ BasePill {
fallbackOffset: 6
targetColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
targetRadius: Theme.cornerRadius
sourceRect.antialiasing: true
sourceRect.smooth: true
shadowEnabled: Theme.elevationEnabled && SettingsData.popoutElevationEnabled && !BlurService.enabled
layer.smooth: true
layer.textureSize: Qt.size(Math.round(width * overflowMenu.dpr * 2), Math.round(height * overflowMenu.dpr * 2))
layer.textureMirroring: ShaderEffectSource.MirrorVertically
layer.samples: 4
shadowEnabled: Theme.elevationEnabled && SettingsData.popoutElevationEnabled
}
Rectangle {
@@ -1450,20 +1425,12 @@ BasePill {
screen: menuRoot.parentScreen
WlrLayershell.layer: root.barUsesOverlayLayer ? WlrLayershell.Overlay : WlrLayershell.Top
WlrLayershell.exclusiveZone: -1
WlrLayershell.keyboardFocus: {
if (PopoutManager.screenshotActive)
return WlrKeyboardFocus.None;
if (!menuRoot.showMenu)
return WlrKeyboardFocus.None;
if (CompositorService.useHyprlandFocusGrab)
return WlrKeyboardFocus.OnDemand;
return WlrKeyboardFocus.Exclusive;
}
WlrLayershell.keyboardFocus: KeyboardFocus.keyboardFocus(menuRoot.showMenu, null)
color: "transparent"
HyprlandFocusGrab {
windows: [menuWindow]
active: CompositorService.useHyprlandFocusGrab && menuRoot.showMenu
windows: [menuWindow].concat(KeyboardFocus.barWindows)
active: KeyboardFocus.wantsGrab(menuRoot.showMenu, null)
}
anchors {
@@ -1502,32 +1469,21 @@ BasePill {
"leftBar": 0,
"rightBar": 0
})
readonly property real effectiveBarSize: root.barThickness + root.barSpacing
readonly property real maskX: _menuDismissZone.x
readonly property real maskY: _menuDismissZone.y
readonly property real maskWidth: _menuDismissZone.width
readonly property real maskHeight: _menuDismissZone.height
readonly property real maskX: {
const triggeringBarX = (barPosition === 2) ? effectiveBarSize : 0;
const adjacentLeftBar = adjacentBarInfo?.leftBar ?? 0;
return Math.max(triggeringBarX, adjacentLeftBar);
}
readonly property real maskY: {
const triggeringBarY = (barPosition === 0) ? effectiveBarSize : 0;
const adjacentTopBar = adjacentBarInfo?.topBar ?? 0;
return Math.max(triggeringBarY, adjacentTopBar);
}
readonly property real maskWidth: {
const triggeringBarRight = (barPosition === 3) ? effectiveBarSize : 0;
const adjacentRightBar = adjacentBarInfo?.rightBar ?? 0;
const rightExclusion = Math.max(triggeringBarRight, adjacentRightBar);
return Math.max(100, width - maskX - rightExclusion);
}
readonly property real maskHeight: {
const triggeringBarBottom = (barPosition === 1) ? effectiveBarSize : 0;
const adjacentBottomBar = adjacentBarInfo?.bottomBar ?? 0;
const bottomExclusion = Math.max(triggeringBarBottom, adjacentBottomBar);
return Math.max(100, height - maskY - bottomExclusion);
DismissZone {
id: _menuDismissZone
barPosition: menuWindow.barPosition
barX: menuWindow.barX
barY: menuWindow.barY
barWidth: menuWindow.barWidth
barHeight: menuWindow.barHeight
screenWidth: menuWindow.width
screenHeight: menuWindow.height
adjacentBarInfo: menuWindow.adjacentBarInfo
}
mask: Region {
@@ -1689,11 +1645,7 @@ BasePill {
fallbackOffset: 6
targetColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
targetRadius: Theme.cornerRadius
sourceRect.antialiasing: true
shadowEnabled: Theme.elevationEnabled && SettingsData.popoutElevationEnabled && !BlurService.enabled
layer.smooth: true
layer.textureSize: Qt.size(Math.round(width * menuWindow.dpr), Math.round(height * menuWindow.dpr))
layer.textureMirroring: ShaderEffectSource.MirrorVertically
shadowEnabled: Theme.elevationEnabled && SettingsData.popoutElevationEnabled
}
Rectangle {